|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.bebop.parameters.ParameterModel
com.arsdigita.bebop.parameters.DateTimeParameter
A class that represents the model for date and time form parameters. (based on the code in DateParameter.java)
Field Summary |
Fields inherited from class com.arsdigita.bebop.parameters.ParameterModel |
m_defaultValue, m_locked, m_name, m_parameterListeners, versionId |
Constructor Summary | |
DateTimeParameter(String name)
|
Method Summary | |
protected Calendar |
getCalendar(javax.servlet.http.HttpServletRequest request)
This method returns a new Calendar object that is manipulated within transformValue to create a Date Object. |
Class |
getValueClass()
Return the class that all values produced by the model will have. |
String |
marshal(Object value)
Produce a string representation of the given value. |
Object |
transformValue(javax.servlet.http.HttpServletRequest request)
Computes a dateTime object from multiple parameters in the request. |
Object |
unmarshal(String encoded)
Reconstruct the parameter value from an encoded string produced by marshal . |
Methods inherited from class com.arsdigita.bebop.parameters.ParameterModel |
addParameterListener, createParameterData, createParameterData, createParameterData, getDefaultOverridesNull, getDefaultValue, getName, isLocked, isPassIn, lock, setDefaultOverridesNull, setDefaultValue, setName, setPassIn, transformSingleValue, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DateTimeParameter(String name)
Method Detail |
protected Calendar getCalendar(javax.servlet.http.HttpServletRequest request)
request
- the servlet request from which Locale can be
extracted if needed
public Object transformValue(javax.servlet.http.HttpServletRequest request) throws IllegalArgumentException
getName() + ".year",
getName() + ".month",
getName() + ".day",
getName() + ".hour",
getName() + ".minute",
getName() + ".second", and
getName() + ".amOrPm".
- Specified by:
transformValue
in class ParameterModel
- Parameters:
request
- The HttpServletRequest of the form submission.
- Throws:
IllegalArgumentException
- if there is an
error transforming form/URL variables to an object.
public Object unmarshal(String encoded)
ParameterModel
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))
.
unmarshal
in class ParameterModel
encoded
- a string produced by marshal
encoded
public String marshal(Object value)
ParameterModel
o
so that
value.equals(o)
.
marshal
in class ParameterModel
value
- a value previously produced by this parameter model
null
public Class getValueClass()
ParameterModel
Object.class
getValueClass
in class ParameterModel
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |