|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.services.intake.model.Field
Base class for Intake generated input processing classes.
Field Summary | |
protected boolean |
alwaysRequired
|
protected RunData |
data
The object containing the request data |
protected java.lang.Object |
defaultValue
|
protected java.lang.String |
displayName
|
protected java.lang.reflect.Method |
getter
|
protected Group |
group
|
protected java.lang.String |
ifRequiredMessage
|
protected boolean |
initialized
|
protected boolean |
isMultiValued
|
protected java.lang.String |
key
|
protected java.lang.String |
mapToObject
|
protected java.lang.String |
message
|
protected java.lang.String |
name
|
protected java.lang.Object |
onError
|
protected boolean |
required
|
protected Retrievable |
retrievable
|
protected boolean |
set_flag
|
protected java.lang.reflect.Method |
setter
|
protected boolean |
valid_flag
|
protected Validator |
validator
|
Constructor Summary | |
Field(XmlField field,
Group group)
Constructs a field based on data in the xml specification and assigns it to a Group. |
Method Summary | |
void |
dispose()
Disposes the object after use. |
protected abstract void |
doSetValue(ParameterParser pp)
Compares request data with constraints and sets the valid flag. |
void |
getDefault()
Loads the default value from the object |
protected java.lang.String |
getDefaultValidator()
|
java.lang.Object |
getDefaultValue()
Get the default Value |
java.lang.String |
getDisplayName()
Get the display name of the field. |
java.lang.Object |
getInitialValue()
Get the value used as a default. |
java.lang.String |
getKey()
Get the key used to identify the field. |
java.lang.String |
getMessage()
Get any error message resulting from invalid input. |
void |
getProperty(java.lang.Object obj)
Loads the valid value from a bean |
java.lang.Object |
getTestValue()
Get the value input by a user that will be validated. |
Validator |
getValidator()
|
java.lang.Object |
getValue()
Get the value of the field. |
java.lang.String |
getValueIfAbsent()
Use in a hidden field assign a default value in the event the field is absent from the query parameters. |
Field |
init(Retrievable obj)
Method called when this field or the group it belongs to is pulled from the pool. |
Field |
init(RunData data)
Method called when this field (the group it belongs to) is pulled from the pool. |
boolean |
isRequired()
Flag to determine whether the field has been declared as required. |
boolean |
isSet()
Flag set to true, if the test value has been set to anything other than an empty value. |
boolean |
isValid()
Flag set to true, if the test value met the constraints. |
void |
removeFromRequest()
Removes references to this group and its fields from the query parameters |
protected abstract void |
setDefaultValue(java.lang.String prop)
Set the default Value |
void |
setDisplayName(java.lang.String newDisplayName)
Set the display name of the field. |
void |
setMessage(java.lang.String message)
Sets an error message. |
void |
setProperty(java.lang.Object obj)
Calls a setter method on obj, if this field has been set. |
void |
setRequired(boolean v)
Set whether this field is required to have a value. |
void |
setRequired(boolean v,
java.lang.String message)
Set the value of required. |
java.lang.String |
toString()
Calls toString() on the object returned by getValue(), unless null; and then it returns "", the empty String. |
protected boolean |
validate(ParameterParser pp)
Compares request data with constraints and sets the valid flag. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final java.lang.String name
protected final java.lang.String key
protected java.lang.String displayName
protected final java.lang.String mapToObject
protected Validator validator
protected final java.lang.reflect.Method getter
protected final java.lang.reflect.Method setter
protected final java.lang.String ifRequiredMessage
protected final boolean isMultiValued
protected final Group group
protected boolean alwaysRequired
protected java.lang.Object onError
protected java.lang.Object defaultValue
protected boolean set_flag
protected boolean valid_flag
protected boolean required
protected boolean initialized
protected java.lang.String message
protected Retrievable retrievable
protected RunData data
Constructor Detail |
public Field(XmlField field, Group group) throws java.lang.Exception
field
- a XmlField
valuegroup
- a Group
valuejava.lang.Exception
- if an error occursMethod Detail |
public Field init(RunData data) throws TurbineException
data
- a RunData
valueField
valueTurbineException
- if an error occurspublic Field init(Retrievable obj)
obj
- a Retrievable
valueField
valueprotected java.lang.String getDefaultValidator()
public Validator getValidator()
public boolean isRequired()
public void setRequired(boolean v)
v
- Value to assign to required.public void setRequired(boolean v, java.lang.String message)
v
- a boolean
valuemessage,
- override the value from intake.xmlpublic void removeFromRequest()
public void dispose()
public java.lang.String getKey()
public java.lang.String getValueIfAbsent()
public boolean isValid()
boolean
valuepublic boolean isSet()
boolean
valuepublic java.lang.String getDisplayName()
String
valuepublic void setDisplayName(java.lang.String newDisplayName)
public java.lang.String getMessage()
String
valuepublic void setMessage(java.lang.String message)
protected boolean validate(ParameterParser pp)
protected abstract void doSetValue(ParameterParser pp)
protected abstract void setDefaultValue(java.lang.String prop)
public java.lang.Object getInitialValue() throws java.lang.Exception
Retrievable
object has
been associated with this field, the objects property will
be used as the initial value.Object
valuejava.lang.Exception
- if an error occurspublic java.lang.Object getTestValue()
Object
valuepublic java.lang.Object getValue()
Object
valuepublic java.lang.String toString()
toString
in class java.lang.Object
String
valuepublic void getProperty(java.lang.Object obj) throws java.lang.Exception
public void getDefault()
public void setProperty(java.lang.Object obj) throws TurbineException
throws
- a TurbineException if called and the input
was not valid.public java.lang.Object getDefaultValue()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |