public static void validateArgument ( Method method , Class < ? extends Annotation > annotationType , Class < ? > expectedParameterType ) { if ( method . getParameterTypes ( ) . length != 1 || ! method . getParameterTypes ( ) [ 0 ] . equals ( expectedParameterType ) ) { throw new BeanCreationException ( String . format ( "Method %s with @%s MUST take a single argument of type %s" , method , annotationType . getName ( ) , expectedParameterType . getName ( ) ) ) ; } }
Validates that the method annotated with the specified annotation has a single argument of the expected type .