com.arsdigita.bebop.parameters
Class StringParameter
java.lang.Object
com.arsdigita.bebop.parameters.ParameterModel
com.arsdigita.bebop.parameters.StringParameter
- All Implemented Interfaces:
- Lockable
- Direct Known Subclasses:
- EmailParameter, EnumerationParameter, TrimmedStringParameter, URLParameter
- public class StringParameter
- extends ParameterModel
A string parameter. The value for this parameter model is copied
verbatim from the request. This parameter will never cause a validation
error.
- Version:
- $Id: //core-platform/dev/src/com/arsdigita/bebop/parameters/StringParameter.java#7 $
- Author:
- Karl Goldstein, Uday Mathur
Constructor Summary |
StringParameter(String name)
Create a new parameter which is filled from the request parameter
with the given name. |
Methods inherited from class com.arsdigita.bebop.parameters.ParameterModel |
addParameterListener, createParameterData, createParameterData, createParameterData, getDefaultOverridesNull, getDefaultValue, getName, isLocked, isPassIn, lock, marshal, setDefaultOverridesNull, setDefaultValue, setName, setPassIn, transformSingleValue, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
versionId
public static final String versionId
- See Also:
- Constant Field Values
StringParameter
public StringParameter(String name)
- Create a new parameter which is filled from the request parameter
with the given name.
- Parameters:
name
- the name of the request parameter from which the string
is read.
transformValue
public Object transformValue(javax.servlet.http.HttpServletRequest request)
- Retrieve the string from its request parameter. The returned object
is of class
String
. If the request parameter is
not present, null
is returned.
- Specified by:
transformValue
in class ParameterModel
- Parameters:
request
- represents the current request
- Returns:
- the
String
from the request parameter or
null
if the parameter does not occur in the request.
unmarshal
public Object unmarshal(String encoded)
- Description copied from class:
ParameterModel
- Reconstruct the parameter value from an encoded string produced by
marshal
. This is an optional operation, which needs
to be implemented by specific subclasses; this implementation just
throws an UnsupportedOperationException
.
The contract between marshal
and
unmarshal
is that for any possible object
obj
this parameter model can produce
obj.equals(unmarshal(marshal(obj))
.
- Overrides:
unmarshal
in class ParameterModel
- Parameters:
encoded
- a string produced by marshal
- Returns:
- the object represented by
encoded
getValueClass
public Class getValueClass()
- Description copied from class:
ParameterModel
- Return the class that all values produced by the model will
have. This should be the most specific common base class of all
classes of which the model will ever produce values. This
implementation returns
Object.class
- Overrides:
getValueClass
in class ParameterModel
- Returns:
- the class that all values produced by the model will
have.
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC