Class LocalParameterMap

java.lang.Object
org.springframework.webflow.core.collection.LocalParameterMap
All Implemented Interfaces:
Serializable, MapAdaptable<String,Object>, ParameterMap
Direct Known Subclasses:
MockParameterMap

public class LocalParameterMap extends Object implements ParameterMap, Serializable
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.
Author:
Keith Donald
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new parameter map from the provided map.
    LocalParameterMap(Map<String,Object> parameters, ConversionService conversionService)
    Creates a new parameter map from the provided map.
  • Method Summary

    Modifier and Type
    Method
    Description
    Adapts this parameter map to an AttributeMap.
    Returns this object's contents as a Map.
    boolean
    contains(String parameterName)
    Does the parameter with the provided name exist in this map?
    boolean
     
    get(String parameterName)
    Get a parameter value, returning null if no value is found.
    <T> T
    get(String parameterName, Class<T> targetType)
    Get a parameter value, converting it from String to the target type.
    <T> T
    get(String parameterName, Class<T> targetType, T defaultValue)
    Get a parameter value, converting it from String to the target type or returning the defaultValue if not found.
    get(String parameterName, String defaultValue)
    Get a parameter value, returning the defaultValue if no value is found.
    getArray(String parameterName)
    Get a multi-valued parameter value, returning null if no value is found.
    <T> T[]
    getArray(String parameterName, Class<T> targetElementType)
    Get a multi-valued parameter value, converting each value to the target type or returning null if no value is found.
    getBoolean(String parameterName)
    Returns a boolean parameter value in the map, returning null if no value was found.
    getBoolean(String parameterName, Boolean defaultValue)
    Returns a boolean parameter value in the map, returning the defaultValue if no value was found.
    getInteger(String parameterName)
    Returns an integer parameter value in the map, returning null if no value was found.
    getInteger(String parameterName, Integer defaultValue)
    Returns an integer parameter value in the map, returning the defaultValue if no value was found.
    getLong(String parameterName)
    Returns a long parameter value in the map, returning null if no value was found.
    getLong(String parameterName, Long defaultValue)
    Returns a long parameter value in the map, returning the defaultValue if no value was found.
    protected Map<String,Object>
    Returns the wrapped, modifiable map implementation.
    org.springframework.web.multipart.MultipartFile
    getMultipartFile(String parameterName)
    Get a multi-part file parameter value, returning null if no value is found.
    <T extends Number>
    T
    getNumber(String parameterName, Class<T> targetType)
    Returns a number parameter value in the map that is of the specified type, returning null if no value was found.
    <T extends Number>
    T
    getNumber(String parameterName, 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.
    getRequired(String parameterName)
    Get the value of a required parameter.
    <T> T
    getRequired(String parameterName, Class<T> targetType)
    Get the value of a required parameter and convert it to the target type.
    getRequiredArray(String parameterName)
    Get a required multi-valued parameter value.
    <T> T[]
    getRequiredArray(String parameterName, Class<T> targetElementType)
    Get a required multi-valued parameter value, converting each value to the target type.
    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.
    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.
    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
    Get the value of a required multipart file parameter.
    <T extends Number>
    T
    getRequiredNumber(String parameterName, 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
     
    protected void
    Initializes this parameter map.
    boolean
    Is this parameter map empty, with a size of 0?
    int
    Returns the number of parameters in this map.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LocalParameterMap

      public LocalParameterMap(Map<String,Object> parameters)
      Creates a new parameter map from the provided map.

      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:
      parameters - the contents of this parameter map
    • LocalParameterMap

      public LocalParameterMap(Map<String,Object> parameters, ConversionService conversionService)
      Creates a new parameter map from the provided map.

      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:
      parameters - the contents of this parameter map
      conversionService - a helper for performing type conversion of map entry values
  • Method Details