|
Spring Web Flow | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.webflow.core.collection.LocalParameterMap
public class LocalParameterMap
An immutable parameter map storing String-keyed, String-valued parameters in a backing Map
implementation.
This base provides convenient operations for accessing parameters in a typed-manner.
Constructor Summary | |
---|---|
LocalParameterMap(java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a new parameter map from the provided map. |
|
LocalParameterMap(java.util.Map<java.lang.String,java.lang.Object> parameters,
ConversionService conversionService)
Creates a new parameter map from the provided map. |
Method Summary | ||
---|---|---|
AttributeMap<java.lang.Object> |
asAttributeMap()
Adapts this parameter map to an AttributeMap . |
|
java.util.Map<java.lang.String,java.lang.Object> |
asMap()
Returns this object's contents as a Map . |
|
boolean |
contains(java.lang.String parameterName)
Does the parameter with the provided name exist in this map? |
|
boolean |
equals(java.lang.Object o)
|
|
java.lang.String |
get(java.lang.String parameterName)
Get a parameter value, returning null if no value is found. |
|
|
get(java.lang.String parameterName,
java.lang.Class<T> targetType)
Get a parameter value, converting it from String to the target type. |
|
|
get(java.lang.String parameterName,
java.lang.Class<T> targetType,
T defaultValue)
Get a parameter value, converting it from String to the target type or returning the defaultValue if
not found. |
|
java.lang.String |
get(java.lang.String parameterName,
java.lang.String defaultValue)
Get a parameter value, returning the defaultValue if no value is found. |
|
java.lang.String[] |
getArray(java.lang.String parameterName)
Get a multi-valued parameter value, returning null if no value is found. |
|
|
getArray(java.lang.String parameterName,
java.lang.Class<T> targetElementType)
Get a multi-valued parameter value, converting each value to the target type or returning null if no
value is found. |
|
java.lang.Boolean |
getBoolean(java.lang.String parameterName)
Returns a boolean parameter value in the map, returning null if no value was found. |
|
java.lang.Boolean |
getBoolean(java.lang.String parameterName,
java.lang.Boolean defaultValue)
Returns a boolean parameter value in the map, returning the defaultValue if no value was found. |
|
java.lang.Integer |
getInteger(java.lang.String parameterName)
Returns an integer parameter value in the map, returning null if no value was found. |
|
java.lang.Integer |
getInteger(java.lang.String parameterName,
java.lang.Integer defaultValue)
Returns an integer parameter value in the map, returning the defaultValue if no value was found. |
|
java.lang.Long |
getLong(java.lang.String parameterName)
Returns a long parameter value in the map, returning null if no value was found. |
|
java.lang.Long |
getLong(java.lang.String parameterName,
java.lang.Long defaultValue)
Returns a long parameter value in the map, returning the defaultValue if no value was found. |
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getMapInternal()
Returns the wrapped, modifiable map implementation. |
|
org.springframework.web.multipart.MultipartFile |
getMultipartFile(java.lang.String parameterName)
Get a multi-part file parameter value, returning null if no value is found. |
|
|
getNumber(java.lang.String parameterName,
java.lang.Class<T> targetType)
Returns a number parameter value in the map that is of the specified type, returning null if no
value was found. |
|
|
getNumber(java.lang.String parameterName,
java.lang.Class<T> targetType,
T defaultValue)
Returns a number parameter value in the map of the specified type, returning the defaultValue if no value was found. |
|
java.lang.String |
getRequired(java.lang.String parameterName)
Get the value of a required parameter. |
|
|
getRequired(java.lang.String parameterName,
java.lang.Class<T> targetType)
Get the value of a required parameter and convert it to the target type. |
|
java.lang.String[] |
getRequiredArray(java.lang.String parameterName)
Get a required multi-valued parameter value. |
|
|
getRequiredArray(java.lang.String parameterName,
java.lang.Class<T> targetElementType)
Get a required multi-valued parameter value, converting each value to the target type. |
|
java.lang.Boolean |
getRequiredBoolean(java.lang.String parameterName)
Returns a boolean parameter value in the map, throwing an exception if the parameter is not present or could not be converted. |
|
java.lang.Integer |
getRequiredInteger(java.lang.String parameterName)
Returns an integer parameter value in the map, throwing an exception if the parameter is not present or could not be converted. |
|
java.lang.Long |
getRequiredLong(java.lang.String parameterName)
Returns a long parameter value in the map, throwing an exception if the parameter is not present or could not be converted. |
|
org.springframework.web.multipart.MultipartFile |
getRequiredMultipartFile(java.lang.String parameterName)
Get the value of a required multipart file parameter. |
|
|
getRequiredNumber(java.lang.String parameterName,
java.lang.Class<T> targetType)
Returns a number parameter value in the map, throwing an exception if the parameter is not present or could not be converted. |
|
int |
hashCode()
|
|
protected void |
initParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
Initializes this parameter map. |
|
boolean |
isEmpty()
Is this parameter map empty, with a size of 0? |
|
int |
size()
Returns the number of parameters in this map. |
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LocalParameterMap(java.util.Map<java.lang.String,java.lang.Object> parameters)
It is expected that the contents of the backing map adhere to the parameter map contract; that is, map entries have string keys, string values, and remain unmodifiable.
parameters
- the contents of this parameter mappublic LocalParameterMap(java.util.Map<java.lang.String,java.lang.Object> parameters, ConversionService conversionService)
It is expected that the contents of the backing map adhere to the parameter map contract; that is, map entries have string keys, string values, and remain unmodifiable.
parameters
- the contents of this parameter mapconversionService
- a helper for performing type conversion of map entry valuesMethod Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Map<java.lang.String,java.lang.Object> asMap()
MapAdaptable
Map
. The returned map may or may not be modifiable depending on this
implementation.
Warning: this operation may be called frequently; if so care should be taken so that the map contents (if calculated) be cached as appropriate.
asMap
in interface MapAdaptable<java.lang.String,java.lang.Object>
public boolean isEmpty()
ParameterMap
isEmpty
in interface ParameterMap
public int size()
ParameterMap
size
in interface ParameterMap
public boolean contains(java.lang.String parameterName)
ParameterMap
contains
in interface ParameterMap
parameterName
- the parameter name
public java.lang.String get(java.lang.String parameterName)
ParameterMap
null
if no value is found.
get
in interface ParameterMap
parameterName
- the parameter name
public java.lang.String get(java.lang.String parameterName, java.lang.String defaultValue)
ParameterMap
get
in interface ParameterMap
parameterName
- the parameter namedefaultValue
- the default
public java.lang.String[] getArray(java.lang.String parameterName)
ParameterMap
null
if no value is found. If the parameter is single
valued an array with a single element is returned.
getArray
in interface ParameterMap
parameterName
- the parameter name
public <T> T[] getArray(java.lang.String parameterName, java.lang.Class<T> targetElementType) throws ConversionExecutionException
ParameterMap
null
if no
value is found.
getArray
in interface ParameterMap
parameterName
- the parameter nametargetElementType
- the target type of the array's elements
ConversionExecutionException
- when the value could not be convertedpublic <T> T get(java.lang.String parameterName, java.lang.Class<T> targetType) throws ConversionExecutionException
ParameterMap
String
to the target type.
get
in interface ParameterMap
parameterName
- the name of the parametertargetType
- the target type of the parameter value
ConversionExecutionException
- when the value could not be convertedpublic <T> T get(java.lang.String parameterName, java.lang.Class<T> targetType, T defaultValue) throws ConversionExecutionException
ParameterMap
String
to the target type or returning the defaultValue if
not found.
get
in interface ParameterMap
parameterName
- name of the parameter to gettargetType
- the target type of the parameter valuedefaultValue
- the default value
ConversionExecutionException
- when a value could not be convertedpublic java.lang.String getRequired(java.lang.String parameterName) throws java.lang.IllegalArgumentException
ParameterMap
getRequired
in interface ParameterMap
parameterName
- the name of the parameter
java.lang.IllegalArgumentException
- when the parameter is not foundpublic java.lang.String[] getRequiredArray(java.lang.String parameterName) throws java.lang.IllegalArgumentException
ParameterMap
getRequiredArray
in interface ParameterMap
parameterName
- the name of the parameter
java.lang.IllegalArgumentException
- when the parameter is not foundpublic <T> T[] getRequiredArray(java.lang.String parameterName, java.lang.Class<T> targetElementType) throws java.lang.IllegalArgumentException, ConversionExecutionException
ParameterMap
getRequiredArray
in interface ParameterMap
parameterName
- the name of the parameter
java.lang.IllegalArgumentException
- when the parameter is not found
ConversionExecutionException
- when a value could not be convertedpublic <T> T getRequired(java.lang.String parameterName, java.lang.Class<T> targetType) throws java.lang.IllegalArgumentException, ConversionExecutionException
ParameterMap
getRequired
in interface ParameterMap
parameterName
- the name of the parametertargetType
- the target type of the parameter value
java.lang.IllegalArgumentException
- when the parameter is not found
ConversionExecutionException
- when the value could not be convertedpublic <T extends java.lang.Number> T getNumber(java.lang.String parameterName, java.lang.Class<T> targetType) throws ConversionExecutionException
ParameterMap
null
if no
value was found.
getNumber
in interface ParameterMap
parameterName
- the parameter nametargetType
- the target number type
ConversionExecutionException
- when the value could not be convertedpublic <T extends java.lang.Number> T getNumber(java.lang.String parameterName, java.lang.Class<T> targetType, T defaultValue) throws ConversionExecutionException
ParameterMap
getNumber
in interface ParameterMap
parameterName
- the parameter namedefaultValue
- the default
ConversionExecutionException
- when the value could not be convertedpublic <T extends java.lang.Number> T getRequiredNumber(java.lang.String parameterName, java.lang.Class<T> targetType) throws java.lang.IllegalArgumentException, ConversionExecutionException
ParameterMap
getRequiredNumber
in interface ParameterMap
parameterName
- the parameter name
java.lang.IllegalArgumentException
- if the parameter is not present
ConversionExecutionException
- when the value could not be convertedpublic java.lang.Integer getInteger(java.lang.String parameterName) throws ConversionExecutionException
ParameterMap
null
if no value was found.
getInteger
in interface ParameterMap
parameterName
- the parameter name
ConversionExecutionException
- when the value could not be convertedpublic java.lang.Integer getInteger(java.lang.String parameterName, java.lang.Integer defaultValue) throws ConversionExecutionException
ParameterMap
getInteger
in interface ParameterMap
parameterName
- the parameter namedefaultValue
- the default
ConversionExecutionException
- when the value could not be convertedpublic java.lang.Integer getRequiredInteger(java.lang.String parameterName) throws java.lang.IllegalArgumentException, ConversionExecutionException
ParameterMap
getRequiredInteger
in interface ParameterMap
parameterName
- the parameter name
java.lang.IllegalArgumentException
- if the parameter is not present
ConversionExecutionException
- when the value could not be convertedpublic java.lang.Long getLong(java.lang.String parameterName) throws ConversionExecutionException
ParameterMap
null
if no value was found.
getLong
in interface ParameterMap
parameterName
- the parameter name
ConversionExecutionException
- when the value could not be convertedpublic java.lang.Long getLong(java.lang.String parameterName, java.lang.Long defaultValue) throws ConversionExecutionException
ParameterMap
getLong
in interface ParameterMap
parameterName
- the parameter namedefaultValue
- the default
ConversionExecutionException
- when the value could not be convertedpublic java.lang.Long getRequiredLong(java.lang.String parameterName) throws java.lang.IllegalArgumentException, ConversionExecutionException
ParameterMap
getRequiredLong
in interface ParameterMap
parameterName
- the parameter name
java.lang.IllegalArgumentException
- if the parameter is not present
ConversionExecutionException
- when the value could not be convertedpublic java.lang.Boolean getBoolean(java.lang.String parameterName) throws ConversionExecutionException
ParameterMap
null
if no value was found.
getBoolean
in interface ParameterMap
parameterName
- the parameter name
ConversionExecutionException
- when the value could not be convertedpublic java.lang.Boolean getBoolean(java.lang.String parameterName, java.lang.Boolean defaultValue) throws ConversionExecutionException
ParameterMap
getBoolean
in interface ParameterMap
parameterName
- the parameter namedefaultValue
- the default
ConversionExecutionException
- when the value could not be convertedpublic java.lang.Boolean getRequiredBoolean(java.lang.String parameterName) throws java.lang.IllegalArgumentException, ConversionExecutionException
ParameterMap
getRequiredBoolean
in interface ParameterMap
parameterName
- the parameter name
java.lang.IllegalArgumentException
- if the parameter is not present
ConversionExecutionException
- when the value could not be convertedpublic org.springframework.web.multipart.MultipartFile getMultipartFile(java.lang.String parameterName)
ParameterMap
null
if no value is found.
getMultipartFile
in interface ParameterMap
parameterName
- the parameter name
public org.springframework.web.multipart.MultipartFile getRequiredMultipartFile(java.lang.String parameterName) throws java.lang.IllegalArgumentException
ParameterMap
getRequiredMultipartFile
in interface ParameterMap
parameterName
- the name of the parameter
java.lang.IllegalArgumentException
- when the parameter is not foundpublic AttributeMap<java.lang.Object> asAttributeMap()
ParameterMap
AttributeMap
.
asAttributeMap
in interface ParameterMap
protected void initParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
parameters
- the parametersprotected java.util.Map<java.lang.String,java.lang.Object> getMapInternal()
public java.lang.String toString()
toString
in class java.lang.Object
|
Spring Web Flow | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |