public class MapInjectionResolver extends InjectionResolver<Param>
Modifier and Type | Field and Description |
---|---|
static LocalStringManagerImpl |
localStrings |
type
Constructor and Description |
---|
MapInjectionResolver(CommandModel model,
ParameterMap parameters) |
MapInjectionResolver(CommandModel model,
ParameterMap parameters,
org.jvnet.hk2.component.MultiMap<String,File> optionNameToUploadedFileMap) |
Modifier and Type | Method and Description |
---|---|
static Object |
convertListToObject(AnnotatedElement target,
Class type,
List<String> paramValList)
Convert the List
|
static String |
getUploadedFileParamValue(String fieldName,
Class fieldType,
org.jvnet.hk2.component.MultiMap<String,File> optionNameToFileMap)
Returns the path to the uploaded file if the specified field is of type
File and if the field name is the same as one of the option names that
was associated with an uploaded File in the incoming command request.
|
static List<String> |
getUploadedFileParamValues(String fieldName,
Class fieldType,
org.jvnet.hk2.component.MultiMap<String,File> optionNameToFileMap)
Returns the paths to the uploaded files if the specified field is of type
File[] and if the field name is the same as one of the option names that
was associated with an uploaded File in the incoming command request.
|
<V> V |
getValue(Object component,
AnnotatedElement target,
Type genericType,
Class<V> type)
Returns the value to inject in the field or method of component annotated with
the annotated annotation.
|
boolean |
isOptional(AnnotatedElement element,
Param annotation)
Returns true if the resolution of this injection identified by the
passed annotation instance is optional
|
void |
setContext(ExecutionContext context)
Set the context that is passed to the DynamicParamImpl.defaultValue method.
|
getSetterMethod
public static final LocalStringManagerImpl localStrings
public MapInjectionResolver(CommandModel model, ParameterMap parameters)
public MapInjectionResolver(CommandModel model, ParameterMap parameters, org.jvnet.hk2.component.MultiMap<String,File> optionNameToUploadedFileMap)
public void setContext(ExecutionContext context)
public boolean isOptional(AnnotatedElement element, Param annotation)
InjectionResolver
isOptional
in class InjectionResolver<Param>
element
- is the annotated java element Method
or Field
annotation
- the injection metadatagetValue()
can return null without generating a
faulty injection operationpublic <V> V getValue(Object component, AnnotatedElement target, Type genericType, Class<V> type) throws org.glassfish.hk2.api.MultiException
InjectionResolverQuery
component
- injection target instancetarget
- is the annotated java element Method
or Field
genericType
- the generic type of the expected returntype
- type of the expected returnorg.glassfish.hk2.api.MultiException
- if the resource cannot be located.public static String getUploadedFileParamValue(String fieldName, Class fieldType, org.jvnet.hk2.component.MultiMap<String,File> optionNameToFileMap)
fieldName
- name of the field being injectedfieldType
- type of the field being injectedoptionNameToFileMap
- map of field names to uploaded Filespublic static List<String> getUploadedFileParamValues(String fieldName, Class fieldType, org.jvnet.hk2.component.MultiMap<String,File> optionNameToFileMap)
fieldName
- name of the field being injectedfieldType
- type of the field being injectedoptionNameToFileMap
- map of field names to uploaded Filespublic static Object convertListToObject(AnnotatedElement target, Class type, List<String> paramValList)
target
- the target fieldtype
- the type of class to convertparamValList
- the List of String values to convertCopyright © 2019. All rights reserved.