org.springframework.web.bind
Class ServletRequestParameterPropertyValues


public class ServletRequestParameterPropertyValues
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.

Author:
Rod Johnson
Version: $Id: ServletRequestParameterPropertyValues.java,v 1.2 2003/10/08 14:16:19 jhoeller Exp $

Field Summary
 final static StringDEFAULT_PREFIX_SEPARATOR
          Default prefix separator

Constructor Summary
ServletRequestParameterPropertyValues(ServletRequest request, String prefix)
          Create new ServletRequestPropertyValues using the default prefix separator and the given prefix (the underscore character "_").
ServletRequestParameterPropertyValues(ServletRequest request)
          Create new ServletRequestPropertyValues using no prefix (and hence, no prefix separator).
ServletRequestParameterPropertyValues(ServletRequest request, String prefix, String prefixSeparator)
          Create new ServletRequestPropertyValues supplying both prefix and prefix separator.

Method Summary
 PropertyValueschangesSince(PropertyValues old)
           
 booleancontains(String propertyName)
           
 PropertyValuegetPropertyValue(String propertyName)
           
 PropertyValue[]getPropertyValues()
           

Field Detail

DEFAULT_PREFIX_SEPARATOR

public final static String DEFAULT_PREFIX_SEPARATOR
Default prefix separator
Constructor Detail

ServletRequestParameterPropertyValues

public ServletRequestParameterPropertyValues(ServletRequest request, String prefix)
Create 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(ServletRequest request)
Create new ServletRequestPropertyValues using no prefix (and hence, no prefix separator).
Parameters:
request - HTTP Request

ServletRequestParameterPropertyValues

public ServletRequestParameterPropertyValues(ServletRequest request, String prefix, String prefixSeparator)
Create new ServletRequestPropertyValues supplying both prefix and prefix separator.
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

changesSince

public PropertyValues changesSince(PropertyValues old)

contains

public boolean contains(String propertyName)

getPropertyValue

public PropertyValue getPropertyValue(String propertyName)

getPropertyValues

public PropertyValue[] getPropertyValues()

Association Links

to Class java.lang.String

Default prefix separator

to Class org.springframework.beans.MutablePropertyValues

PropertyValues delegate. We use delegation rather than simply subclass MutablePropertyValues as we don't want to expose MutablePropertyValues's update methods. This class is immutable once initialized.