org.glassfish.common.util.admin
Class MapInjectionResolver

java.lang.Object
  extended by com.sun.hk2.component.InjectionResolver<Param>
      extended by 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.


Field Summary
static LocalStringManagerImpl localStrings
           
 
Fields inherited from class com.sun.hk2.component.InjectionResolver
type
 
Constructor Summary
MapInjectionResolver(CommandModel model, ParameterMap parameters)
           
MapInjectionResolver(CommandModel model, ParameterMap parameters, org.jvnet.hk2.component.MultiMap<String,File> optionNameToUploadedFileMap)
           
 
Method Summary
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, org.jvnet.hk2.component.Inhabitant<?> onBehalfOf, AnnotatedElement target, Type genericType, Class<V> type)
           
 boolean isOptional(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
 

Field Detail

localStrings

public static final LocalStringManagerImpl localStrings
Constructor Detail

MapInjectionResolver

public MapInjectionResolver(CommandModel model,
                            ParameterMap parameters)

MapInjectionResolver

public MapInjectionResolver(CommandModel model,
                            ParameterMap parameters,
                            org.jvnet.hk2.component.MultiMap<String,File> optionNameToUploadedFileMap)
Method Detail

isOptional

public boolean isOptional(AnnotatedElement element,
                          Param annotation)
Overrides:
isOptional in class com.sun.hk2.component.InjectionResolver<Param>

getValue

public <V> V getValue(Object component,
                      org.jvnet.hk2.component.Inhabitant<?> onBehalfOf,
                      AnnotatedElement target,
                      Type genericType,
                      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 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.

Parameters:
fieldName - name of the field being injected
fieldType - type of the field being injected
optionNameToFileMap - 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 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.

Parameters:
fieldName - name of the field being injected
fieldType - type of the field being injected
optionNameToFileMap - 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.