public static ActionParameter from ( Member member , Annotation [ ] annotations , Class < ? > rawType , Type genericType ) { ActionParameter parameter = null ; String defaultValue = null ; for ( Annotation annotation : annotations ) { if ( annotation instanceof DefaultValue ) { defaultValue = ( ( DefaultValue ) annotation ) . value ( ) ; } else { ParameterFactory factory = BINDINGS . get ( annotation . annotationType ( ) ) ; if ( factory != null ) { parameter = factory . build ( annotation , rawType , genericType ) ; } } } if ( parameter == null ) { // All parameters must have been annotated. throw new IllegalArgumentException ( "The member (Constructor or method) of " + member . getDeclaringClass ( ) . getName ( ) + "." + member . getName ( ) + " has a parameter without annotations indicating the injected data" ) ; } parameter . setDefaultValue ( defaultValue ) ; return parameter ; }
Creates a new action parameter instance from the given parameter . Action Parameter contain the metadata of a specific method or constructor parameter to identify the injected data .