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

Field Summary
static java.lang.String DEFAULT_PREFIX_SEPARATOR
          Default prefix separator
protected  org.apache.commons.logging.Log logger
           
 
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
 
Method Summary
 PropertyValues changesSince(PropertyValues old)
          Return the changes since the previous PropertyValues.
 boolean contains(java.lang.String propertyName)
          Is there a propertyValue object for this property?
 PropertyValue getPropertyValue(java.lang.String propertyName)
          Return the property value with the given name
 PropertyValue[] getPropertyValues()
          Return an array of the PropertyValue objects held in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger

DEFAULT_PREFIX_SEPARATOR

public static final java.lang.String DEFAULT_PREFIX_SEPARATOR
Default prefix separator
Constructor Detail

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 Request
prefix - 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 Request
prefix - prefix for properties
prefixSeparator - Separator delimiting prefix (e.g. user) from property name (e.g. age) to build a request parameter name such as user_age
Method Detail

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.