|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.services.intake.model.Field
Base class for Intake generated input processing classes.
Field Summary | |
protected boolean |
alwaysRequired
Is this field always required? This is only set through the XML file |
static java.lang.String |
defaultFieldPackage
Default Package |
protected java.lang.Object |
defaultValue
Default value of the field |
protected java.lang.String |
displayName
Display name of the field to be used on data entry forms... |
protected java.lang.Object |
emptyValue
Value of the field to use if the mapped parameter is empty or non-existant |
protected java.lang.reflect.Method |
getter
Getter method in the mapped object used to populate the field |
protected Group |
group
Group to which the field belongs |
protected java.lang.String |
ifRequiredMessage
Error message set on the field if required and not set by parser |
protected boolean |
initialized
Has the field has been set from the parser? |
protected boolean |
isDebugEnabled
|
protected boolean |
isMultiValued
Does this field accept multiple values? |
protected java.lang.String |
key
Key used to identify the field in the parser |
protected org.apache.commons.logging.Log |
log
Logging |
protected java.lang.String |
mapToObject
Class name of the object to which the field is mapped |
protected java.lang.String |
message
Error message, is any, resulting from validation |
protected java.lang.String |
name
Name of the field. |
protected java.lang.Object |
onError
Value of the field if an error occurs while getting the value from the mapped object |
protected ValueParser |
parser
The object containing the field data. |
protected boolean |
required
Does the field require a value? |
protected Retrievable |
retrievable
Mapped object used to set the initial field value |
protected boolean |
setFlag
Has the field has been set from the parser? |
protected java.lang.reflect.Method |
setter
Setter method in the mapped object used to store the value of field |
protected Validator |
validator
Used to validate the contents of the field |
protected boolean |
validFlag
Has the field passed the validation test? |
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()
Sets the value of the field from data in the parser. |
protected void |
doSetValue(ValueParser pp)
Deprecated. Use doSetValue() instead (with no parameters). |
void |
getDefault()
Loads the default value from the object |
protected java.lang.String |
getDefaultValidator()
Produces the fully qualified class name of the default validator. |
java.lang.Object |
getDefaultValue()
Get the default Value |
java.lang.String |
getDisplayName()
Get the display name of the field. |
java.lang.String |
getDisplaySize()
Gets the diplay size of the field. |
java.lang.Object |
getEmptyValue()
Get the Value to use if the field is empty |
java.lang.String |
getHTMLString()
Calls toString() on the object returned by getValue(), unless null; and then it returns "", the empty String. |
java.lang.Object |
getInitialValue()
Get the value used as a default. |
java.lang.String |
getKey()
Get the key used to identify the field. |
protected java.util.Locale |
getLocale()
Returns the Locale used when localizing data for
this field, or null if unknown. |
java.lang.String |
getMaxSize()
Gets the maximum size of the field. |
java.lang.String |
getMessage()
Get any error message resulting from invalid input. |
java.lang.String |
getName()
Gets the name of the field. |
void |
getProperty(java.lang.Object obj)
Loads the valid value from a bean |
protected java.lang.Object |
getSafeEmptyValue()
Provides access to emptyValue such that the value returned will be acceptable as an argument parameter to Method.invoke. |
java.lang.String |
getStringValue()
Gets the String representation of the Value. |
java.lang.Object |
getTestValue()
Get the value input by a user that will be validated. |
Validator |
getValidator()
Gets the Validator object for this field. |
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(ValueParser pp)
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 |
abstract void |
setDefaultValue(java.lang.String prop)
Set the default Value. |
void |
setDisplayName(java.lang.String newDisplayName)
Set the display name of the field. |
abstract void |
setEmptyValue(java.lang.String prop)
Set the empty Value. |
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()
Compares request data with constraints and sets the valid flag. |
protected boolean |
validate(ValueParser pp)
Deprecated. Call validate() instead (with no parameters). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String defaultFieldPackage
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 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 java.lang.Object emptyValue
protected boolean setFlag
protected boolean validFlag
protected boolean required
protected boolean initialized
protected java.lang.String message
protected Retrievable retrievable
protected ValueParser parser
protected org.apache.commons.logging.Log log
protected boolean isDebugEnabled
Constructor Detail |
public Field(XmlField field, Group group) throws IntakeException
field
- a XmlField
valuegroup
- a Group
value
IntakeException
- indicates the validator was not valid or
could not be loaded.
SystemError
- only occurs is the Validation object does not
extend InitableByConstraintMapMethod Detail |
public Field init(ValueParser pp) throws IntakeException
pp
- a ValueParser
value
Field
value
IntakeException
- this exception is only thrown by subclasses
overriding this implementation.public Field init(Retrievable obj)
obj
- a Retrievable
value
Field
valueprotected java.util.Locale getLocale()
Locale
used when localizing data for
this field, or null
if unknown.
protected java.lang.String getDefaultValidator()
public Validator getValidator()
Validator
objectpublic 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(ValueParser pp)
protected boolean validate()
public abstract void setDefaultValue(java.lang.String prop)
prop
- The value to use if the field is mapped to a new object.public abstract void setEmptyValue(java.lang.String prop)
prop
- The value to use if the field is empty.protected void doSetValue(ValueParser pp)
protected abstract void doSetValue()
public java.lang.Object getInitialValue() throws IntakeException
Retrievable
object has
been associated with this field, the objects property will
be used as the initial value.
Object
value
IntakeException
- indicates the value could not be
returned from the mapped objectpublic java.lang.Object getTestValue()
Object
valuepublic java.lang.Object getValue()
Object
valuepublic java.lang.String toString()
String
valuepublic java.lang.String getHTMLString()
String
valuepublic void getProperty(java.lang.Object obj) throws IntakeException
IntakeException
- indicates a problem during the execution of the
object's getter methodpublic void getDefault()
public void setProperty(java.lang.Object obj) throws IntakeException
IntakeException
- indicates a problem during the execution of the
object's setter methodpublic java.lang.Object getDefaultValue()
public java.lang.Object getEmptyValue()
protected java.lang.Object getSafeEmptyValue()
public java.lang.String getName()
public java.lang.String getDisplaySize()
public java.lang.String getMaxSize()
public java.lang.String getStringValue()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |