org.codehaus.groovy.grails.web.servlet.mvc
Class GrailsParameterMap

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by org.codehaus.groovy.grails.web.util.AbstractTypeConvertingMap
          extended by org.codehaus.groovy.grails.web.util.TypeConvertingMap
              extended by org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap
All Implemented Interfaces:
groovy.lang.GroovyObject, java.lang.Cloneable, java.util.Map

public class GrailsParameterMap
extends org.codehaus.groovy.grails.web.util.TypeConvertingMap
implements java.lang.Cloneable

A parameter map class that allows mixing of request parameters and controller parameters. If a controller parameter is set with the same name as a request parameter the controller parameter value is retrieved.

Since:
Oct 24, 2005

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
static java.lang.Object[] EMPTY_ARGS
           
static java.lang.String REQUEST_BODY_PARSED
           
 
Fields inherited from class org.codehaus.groovy.grails.web.util.AbstractTypeConvertingMap
wrappedMap
 
Constructor Summary
GrailsParameterMap(javax.servlet.http.HttpServletRequest request)
          Creates a GrailsParameterMap populating from the given request object
GrailsParameterMap(java.util.Map values, javax.servlet.http.HttpServletRequest request)
          Does not populate the GrailsParameterMap from the request but instead uses the supplied values.
 
Method Summary
 java.lang.Object clone()
           
 java.lang.Object get(java.lang.Object key)
           
 java.util.Date getDate(java.lang.String name)
          Obtains a date for the parameter name using the default format
 javax.servlet.http.HttpServletRequest getRequest()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map map)
           
 java.lang.Object remove(java.lang.Object key)
           
 java.lang.String toQueryString()
          Converts this parameter map into a query String.
 
Methods inherited from class org.codehaus.groovy.grails.web.util.TypeConvertingMap
boolean, boolean, byte, byte, char, char, char, double, double, float, float, int, int, long, long, short, short
 
Methods inherited from class org.codehaus.groovy.grails.web.util.AbstractTypeConvertingMap
asBoolean, clear, containsKey, containsValue, date, date, date, entrySet, equals, getBoolean, getBoolean, getByte, getByte, getChar, getChar, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getList, getLong, getLong, getShort, getShort, hashCode, isEmpty, keySet, list, size, toString, values
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface groovy.lang.GroovyObject
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty
 

Field Detail

REQUEST_BODY_PARSED

public static final java.lang.String REQUEST_BODY_PARSED
See Also:
Constant Field Values

EMPTY_ARGS

public static final java.lang.Object[] EMPTY_ARGS
Constructor Detail

GrailsParameterMap

public GrailsParameterMap(java.util.Map values,
                          javax.servlet.http.HttpServletRequest request)
Does not populate the GrailsParameterMap from the request but instead uses the supplied values.

Parameters:
values - The values to populate with
request - The request object

GrailsParameterMap

public GrailsParameterMap(javax.servlet.http.HttpServletRequest request)
Creates a GrailsParameterMap populating from the given request object

Parameters:
request - The request object
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class org.codehaus.groovy.grails.web.util.TypeConvertingMap

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Returns:
Returns the request.

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map
Overrides:
get in class AbstractTypeConvertingMap

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
Overrides:
put in class AbstractTypeConvertingMap

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
Overrides:
remove in class AbstractTypeConvertingMap

putAll

public void putAll(java.util.Map map)
Specified by:
putAll in interface java.util.Map
Overrides:
putAll in class AbstractTypeConvertingMap

getDate

public java.util.Date getDate(java.lang.String name)
Obtains a date for the parameter name using the default format

Overrides:
getDate in class AbstractTypeConvertingMap
Parameters:
name - The name of the parameter
Returns:
A date or null

toQueryString

public java.lang.String toQueryString()
Converts this parameter map into a query String. Note that this will flatten nested keys separating them with the . character and URL encode the result

Returns:
A query String starting with the ? character