com.interface21.web.bind
Class ServletRequestParameterPropertyValues
java.lang.Object
|
+--com.interface21.web.bind.ServletRequestParameterPropertyValues
- All Implemented Interfaces:
- PropertyValues
- public class ServletRequestParameterPropertyValues
- extends java.lang.Object
- implements PropertyValues
PropertyValues implementation created from parameters in a ServletRequest.
Looks for all property values beginning with a certain prefix
and prefix separator.
This class is immutable once initialized.
- Version:
- $Id: ServletRequestParameterPropertyValues.java,v 1.2 2003/05/28 16:39:15 jhoeller Exp $
- Author:
- Rod Johnson
|
Constructor Summary |
ServletRequestParameterPropertyValues(javax.servlet.ServletRequest request)
Creates new ServletRequestPropertyValues using no prefix
(and hence, no prefix separator) |
ServletRequestParameterPropertyValues(javax.servlet.ServletRequest request,
java.lang.String prefix)
Creates new ServletRequestPropertyValues using the default
prefix separator and the given prefix (the underscore character, _). |
ServletRequestParameterPropertyValues(javax.servlet.ServletRequest request,
java.lang.String prefix,
java.lang.String prefixSeparator)
Creates new ServletRequestPropertyValues supplying
both prefix and prefixSeparator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
DEFAULT_PREFIX_SEPARATOR
public static final java.lang.String DEFAULT_PREFIX_SEPARATOR
- Default prefix separator
ServletRequestParameterPropertyValues
public ServletRequestParameterPropertyValues(javax.servlet.ServletRequest request,
java.lang.String prefix)
- Creates new ServletRequestPropertyValues using the default
prefix separator and the given prefix (the underscore character, _).
- Parameters:
request - HTTP Requestprefix - prefix for properties
ServletRequestParameterPropertyValues
public ServletRequestParameterPropertyValues(javax.servlet.ServletRequest request)
- Creates new ServletRequestPropertyValues using no prefix
(and hence, no prefix separator)
- Parameters:
request - HTTP Request
ServletRequestParameterPropertyValues
public ServletRequestParameterPropertyValues(javax.servlet.ServletRequest request,
java.lang.String prefix,
java.lang.String prefixSeparator)
- Creates new ServletRequestPropertyValues supplying
both prefix and prefixSeparator
- Parameters:
request - HTTP Requestprefix - prefix for propertiesprefixSeparator - Separator delimiting prefix (e.g. user) from property name
(e.g. age) to build a request parameter name such as user_age
getPropertyValues
public PropertyValue[] getPropertyValues()
- Return an array of the PropertyValue objects
held in this object.
- Specified by:
getPropertyValues in interface PropertyValues
- Returns:
- an array of the PropertyValue objects
held in this object.
contains
public boolean contains(java.lang.String propertyName)
- Is there a propertyValue object for this property?
- Specified by:
contains in interface PropertyValues
- Parameters:
propertyName - name of the property we're interested in- Returns:
- whether there is a propertyValue object for this property?
getPropertyValue
public PropertyValue getPropertyValue(java.lang.String propertyName)
- Description copied from interface:
PropertyValues
- Return the property value with the given name
- Specified by:
getPropertyValue in interface PropertyValues
- Following copied from interface:
com.interface21.beans.PropertyValues
- Parameters:
propertyName - name to search for- Returns:
- pv or null
changesSince
public PropertyValues changesSince(PropertyValues old)
- Description copied from interface:
PropertyValues
- Return the changes since the previous PropertyValues.
Subclasses should also override equals.
- Specified by:
changesSince in interface PropertyValues
- Following copied from interface:
com.interface21.beans.PropertyValues
- Parameters:
old - old property values- Returns:
- PropertyValues updated or new properties.
Return the empty PropertyValues if there are no changes.
Rod Johnson and Spring contributors 2001-2003.