|
|||||||||||
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.StringParameter
com.arsdigita.bebop.parameters.EmailParameter
An email address parameter. The parameter in the request is only
accepted if it represents a valid email address such as
webmaster@foo.com. The email address from the
request is converted into a InternetAddress
if it looks like a valid email
address. If it does not, the parameter flags a parameter validation
error.
The request value looks like a valid email address if it matches the regular expression ^[^@<>\"\t ]+@[^@<>\".\t]+([.][^@<>\".\n]+)+$
Field Summary |
Fields inherited from class com.arsdigita.bebop.parameters.StringParameter |
versionId |
Fields inherited from class com.arsdigita.bebop.parameters.ParameterModel |
m_defaultValue, m_locked, m_name, m_parameterListeners |
Constructor Summary | |
EmailParameter(String name)
Create a new email parameter corresponding to a request parameter with the given name. |
Method Summary | |
Class |
getValueClass()
Return the class that all values produced by the model will have. |
Object |
transformValue(javax.servlet.http.HttpServletRequest request)
Retrieve the email address from 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, 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 |
Constructor Detail |
public EmailParameter(String name)
name
- the name of the request parameter from which the email
address is read.Method Detail |
public Object transformValue(javax.servlet.http.HttpServletRequest request) throws IllegalArgumentException
null
if the request parameter does not look like a
valid email address.
transformValue
in class StringParameter
request
- represents the current request
InternetAddress
or null
if
there is no request parameter with the email parameter's name.
IllegalArgumentException
- if the request parameter does not
look like a valid email address.public Object unmarshal(String encoded) throws IllegalArgumentException
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 StringParameter
IllegalArgumentException
public Class getValueClass()
ParameterModel
Object.class
getValueClass
in class StringParameter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |