org.glassfish.common.util.admin
Class MapInjectionResolver
java.lang.Object
com.sun.hk2.component.InjectionResolver<Param>
org.glassfish.common.util.admin.MapInjectionResolver
public class MapInjectionResolver
- extends com.sun.hk2.component.InjectionResolver<Param>
An InjectionResolver that uses a ParameterMap object as the source of
the data to inject.
| Fields inherited from class com.sun.hk2.component.InjectionResolver |
type |
|
Method Summary |
static java.lang.String |
getUploadedFileParamValue(java.lang.String fieldName,
java.lang.Class fieldType,
org.jvnet.hk2.component.MultiMap<java.lang.String,java.io.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 java.util.List<java.lang.String> |
getUploadedFileParamValues(java.lang.String fieldName,
java.lang.Class fieldType,
org.jvnet.hk2.component.MultiMap<java.lang.String,java.io.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. |
|
getValue(java.lang.Object component,
org.jvnet.hk2.component.Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type)
|
boolean |
isOptional(java.lang.reflect.AnnotatedElement element,
Param annotation)
|
| Methods inherited from class com.sun.hk2.component.InjectionResolver |
getSetterMethod |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
localStrings
public static final LocalStringManagerImpl localStrings
MapInjectionResolver
public MapInjectionResolver(CommandModel model,
ParameterMap parameters)
MapInjectionResolver
public MapInjectionResolver(CommandModel model,
ParameterMap parameters,
org.jvnet.hk2.component.MultiMap<java.lang.String,java.io.File> optionNameToUploadedFileMap)
isOptional
public boolean isOptional(java.lang.reflect.AnnotatedElement element,
Param annotation)
- Overrides:
isOptional in class com.sun.hk2.component.InjectionResolver<Param>
getValue
public <V> V getValue(java.lang.Object component,
org.jvnet.hk2.component.Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement target,
java.lang.reflect.Type genericType,
java.lang.Class<V> type)
throws org.jvnet.hk2.component.ComponentException
- Specified by:
getValue in class com.sun.hk2.component.InjectionResolver<Param>
- Throws:
org.jvnet.hk2.component.ComponentException
getUploadedFileParamValue
public static java.lang.String getUploadedFileParamValue(java.lang.String fieldName,
java.lang.Class fieldType,
org.jvnet.hk2.component.MultiMap<java.lang.String,java.io.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.
- Parameters:
fieldName - name of the field being injectedfieldType - type of the field being injectedoptionNameToFileMap - map of field names to uploaded Files
- Returns:
- absolute path of the uploaded file for the field;
null if no file uploaded for this field
getUploadedFileParamValues
public static java.util.List<java.lang.String> getUploadedFileParamValues(java.lang.String fieldName,
java.lang.Class fieldType,
org.jvnet.hk2.component.MultiMap<java.lang.String,java.io.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.
- Parameters:
fieldName - name of the field being injectedfieldType - type of the field being injectedoptionNameToFileMap - map of field names to uploaded Files
- Returns:
- List of absolute paths of the uploaded files for the field;
null if no file uploaded for this field
Copyright © 2012 GlassFish Community. All Rights Reserved.