|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ParameterMap
An interface for accessing parameters in a backing map. Parameters are immutable and have string keys and string values.
The accessor methods offered by this class taking a target type argument only need to support conversions to well know types like String, Number subclasses, Boolean and so on.
| Method Summary | |
|---|---|
AttributeMap |
asAttributeMap()
Adapts this parameter map to an AttributeMap. |
boolean |
contains(String parameterName)
Does the parameter with the provided name exist in this map? |
String |
get(String parameterName)
Get a parameter value, returning null if no value is found. |
Object |
get(String parameterName,
Class targetType)
Get a parameter value, converting it from String to the target type. |
Object |
get(String parameterName,
Class targetType,
Object defaultValue)
Get a parameter value, converting it from String to the target type or returning the defaultValue
if not found. |
String |
get(String parameterName,
String defaultValue)
Get a parameter value, returning the defaultValue if no value is found. |
String[] |
getArray(String parameterName)
Get a multi-valued parameter value, returning null if no value is found. |
Object[] |
getArray(String parameterName,
Class targetElementType)
Get a multi-valued parameter value, converting each value to the target type or returning null if
no value is found. |
Boolean |
getBoolean(String parameterName)
Returns a boolean parameter value in the map, returning null if no value was found. |
Boolean |
getBoolean(String parameterName,
Boolean defaultValue)
Returns a boolean parameter value in the map, returning the defaultValue if no value was found. |
Integer |
getInteger(String parameterName)
Returns an integer parameter value in the map, returning null if no value was found. |
Integer |
getInteger(String parameterName,
Integer defaultValue)
Returns an integer parameter value in the map, returning the defaultValue if no value was found. |
Long |
getLong(String parameterName)
Returns a long parameter value in the map, returning null if no value was found. |
Long |
getLong(String parameterName,
Long defaultValue)
Returns a long parameter value in the map, returning the defaultValue if no value was found. |
org.springframework.web.multipart.MultipartFile |
getMultipartFile(String parameterName)
Get a multi-part file parameter value, returning null if no value is found. |
Number |
getNumber(String parameterName,
Class targetType)
Returns a number parameter value in the map that is of the specified type, returning null if no
value was found. |
Number |
getNumber(String parameterName,
Class targetType,
Number defaultValue)
Returns a number parameter value in the map of the specified type, returning the defaultValue if no value was found. |
String |
getRequired(String parameterName)
Get the value of a required parameter. |
Object |
getRequired(String parameterName,
Class targetType)
Get the value of a required parameter and convert it to the target type. |
String[] |
getRequiredArray(String parameterName)
Get a required multi-valued parameter value. |
Object[] |
getRequiredArray(String parameterName,
Class targetElementType)
Get a required multi-valued parameter value, converting each value to the target type. |
Boolean |
getRequiredBoolean(String parameterName)
Returns a boolean parameter value in the map, throwing an exception if the parameter is not present or could not be converted. |
Integer |
getRequiredInteger(String parameterName)
Returns an integer parameter value in the map, throwing an exception if the parameter is not present or could not be converted. |
Long |
getRequiredLong(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(String parameterName)
Get the value of a required multipart file parameter. |
Number |
getRequiredNumber(String parameterName,
Class targetType)
Returns a number parameter value in the map, throwing an exception if the parameter is not present or could not be converted. |
boolean |
isEmpty()
Is this parameter map empty, with a size of 0? |
int |
size()
Returns the number of parameters in this map. |
| Methods inherited from interface org.springframework.binding.collection.MapAdaptable |
|---|
asMap |
| Method Detail |
|---|
boolean isEmpty()
int size()
boolean contains(String parameterName)
parameterName - the parameter name
String get(String parameterName)
null if no value is found.
parameterName - the parameter name
String get(String parameterName,
String defaultValue)
parameterName - the parameter namedefaultValue - the default
String[] getArray(String parameterName)
null if no value is found. If the parameter is
single valued an array with a single element is returned.
parameterName - the parameter name
Object[] getArray(String parameterName,
Class targetElementType)
throws ConversionExecutionException
null if
no value is found.
parameterName - the parameter nametargetElementType - the target type of the array's elements
ConversionExecutionException - when the value could not be converted
Object get(String parameterName,
Class targetType)
throws ConversionExecutionException
String to the target type.
parameterName - the name of the parametertargetType - the target type of the parameter value
ConversionExecutionException - when the value could not be converted
Object get(String parameterName,
Class targetType,
Object defaultValue)
throws ConversionExecutionException
String to the target type or returning the defaultValue
if not found.
parameterName - name of the parameter to gettargetType - the target type of the parameter valuedefaultValue - the default value
ConversionExecutionException - when a value could not be converted
String getRequired(String parameterName)
throws IllegalArgumentException
parameterName - the name of the parameter
IllegalArgumentException - when the parameter is not found
String[] getRequiredArray(String parameterName)
throws IllegalArgumentException
parameterName - the name of the parameter
IllegalArgumentException - when the parameter is not found
Object[] getRequiredArray(String parameterName,
Class targetElementType)
throws IllegalArgumentException,
ConversionExecutionException
parameterName - the name of the parameter
IllegalArgumentException - when the parameter is not found
ConversionExecutionException - when a value could not be converted
Object getRequired(String parameterName,
Class targetType)
throws IllegalArgumentException,
ConversionExecutionException
parameterName - the name of the parametertargetType - the target type of the parameter value
IllegalArgumentException - when the parameter is not found
ConversionExecutionException - when the value could not be converted
Number getNumber(String parameterName,
Class targetType)
throws ConversionExecutionException
null if no
value was found.
parameterName - the parameter nametargetType - the target number type
ConversionExecutionException - when the value could not be converted
Number getNumber(String parameterName,
Class targetType,
Number defaultValue)
throws ConversionExecutionException
parameterName - the parameter namedefaultValue - the default
ConversionExecutionException - when the value could not be converted
Number getRequiredNumber(String parameterName,
Class targetType)
throws IllegalArgumentException,
ConversionExecutionException
parameterName - the parameter name
IllegalArgumentException - if the parameter is not present
ConversionExecutionException - when the value could not be converted
Integer getInteger(String parameterName)
throws ConversionExecutionException
null if no value was found.
parameterName - the parameter name
ConversionExecutionException - when the value could not be converted
Integer getInteger(String parameterName,
Integer defaultValue)
throws ConversionExecutionException
parameterName - the parameter namedefaultValue - the default
ConversionExecutionException - when the value could not be converted
Integer getRequiredInteger(String parameterName)
throws IllegalArgumentException,
ConversionExecutionException
parameterName - the parameter name
IllegalArgumentException - if the parameter is not present
ConversionExecutionException - when the value could not be converted
Long getLong(String parameterName)
throws ConversionExecutionException
null if no value was found.
parameterName - the parameter name
ConversionExecutionException - when the value could not be converted
Long getLong(String parameterName,
Long defaultValue)
throws ConversionExecutionException
parameterName - the parameter namedefaultValue - the default
ConversionExecutionException - when the value could not be converted
Long getRequiredLong(String parameterName)
throws IllegalArgumentException,
ConversionExecutionException
parameterName - the parameter name
IllegalArgumentException - if the parameter is not present
ConversionExecutionException - when the value could not be converted
Boolean getBoolean(String parameterName)
throws ConversionExecutionException
null if no value was found.
parameterName - the parameter name
ConversionExecutionException - when the value could not be converted
Boolean getBoolean(String parameterName,
Boolean defaultValue)
throws ConversionExecutionException
parameterName - the parameter namedefaultValue - the default
ConversionExecutionException - when the value could not be converted
Boolean getRequiredBoolean(String parameterName)
throws IllegalArgumentException,
ConversionExecutionException
parameterName - the parameter name
IllegalArgumentException - if the parameter is not present
ConversionExecutionException - when the value could not be convertedorg.springframework.web.multipart.MultipartFile getMultipartFile(String parameterName)
null if no value is found.
parameterName - the parameter name
org.springframework.web.multipart.MultipartFile getRequiredMultipartFile(String parameterName)
parameterName - the name of the parameter
IllegalArgumentException - when the parameter is not foundAttributeMap asAttributeMap()
AttributeMap.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||