public class Form
extends java.lang.Object
implements java.io.Serializable
This contains a set of validation rules for a form/JavaBean. The information is
contained in a list of Field objects. Instances of this class are
configured with a <form> xml element.
The use of FastHashMap is deprecated and will be replaced in a future release.
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.collections.FastHashMap |
hFields
Map of
Fields keyed on their property value. |
protected java.util.List |
lFields
List of
Fields. |
protected java.lang.String |
name
The name/key the set of validation rules is
stored under.
|
| Constructor and Description |
|---|
Form() |
| Modifier and Type | Method and Description |
|---|---|
void |
addField(Field f)
Add a
Field to the Form. |
boolean |
containsField(java.lang.String fieldName)
Returns true if this Form contains a Field with the given name.
|
Field |
getField(java.lang.String fieldName)
Returns the Field with the given name or null if this Form has no such
field.
|
java.util.Map |
getFieldMap()
Deprecated.
Use containsField(String) and getField(String) instead.
|
java.util.List |
getFields()
A
List of Fields is returned as an
unmodifiable List. |
java.lang.String |
getName()
Gets the name/key of the set of validation rules.
|
void |
process(java.util.Map globalConstants,
java.util.Map constants)
Deprecated.
This method is called by the framework. It will be made protected
in a future release. TODO
|
void |
setName(java.lang.String name)
Sets the name/key of the set of validation rules.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
(package private) ValidatorResults |
validate(java.util.Map params,
java.util.Map actions,
int page)
Validate all Fields in this Form on the given page and below.
|
protected java.lang.String name
protected java.util.List lFields
Fields. Used to maintain
the order they were added in although individual
Fields can be retrieved using
Map of Fields.protected org.apache.commons.collections.FastHashMap hFields
Fields keyed on their property value.public java.lang.String getName()
public void setName(java.lang.String name)
public void addField(Field f)
Field to the Form.public java.util.List getFields()
List of Fields is returned as an
unmodifiable List.public java.util.Map getFieldMap()
Fields are returned as an unmodifiable Map.public Field getField(java.lang.String fieldName)
public boolean containsField(java.lang.String fieldName)
public void process(java.util.Map globalConstants,
java.util.Map constants)
Form's Fields.public java.lang.String toString()
toString in class java.lang.ObjectValidatorResults validate(java.util.Map params, java.util.Map actions, int page) throws ValidatorException
params - A Map of parameter class names to parameter values to pass
into validation methods.actions - A Map of validator names to ValidatorAction objects.page - Fields on pages higher than this will not be validated.ValidatorExceptionCopyright (c) 2001-2004 Apache Software Foundation