|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.validator.Form
public class Form
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.
Field Summary | |
---|---|
protected org.apache.commons.collections.FastHashMap |
hFields
Deprecated. Subclasses should use getFieldMap() instead. |
protected String |
inherit
The name/key of the form which this form extends from. |
protected List |
lFields
List of Field s. |
protected String |
name
The name/key the set of validation rules is stored under. |
Constructor Summary | |
---|---|
Form()
|
Method Summary | |
---|---|
void |
addField(Field f)
Add a Field to the Form . |
boolean |
containsField(String fieldName)
Returns true if this Form contains a Field with the given name. |
String |
getExtends()
Gets the name/key of the parent set of validation rules. |
Field |
getField(String fieldName)
Returns the Field with the given name or null if this Form has no such field. |
protected Map |
getFieldMap()
Returns a Map of String field keys to Field objects. |
List |
getFields()
A List of Field s is returned as an unmodifiable
List . |
String |
getName()
Gets the name/key of the set of validation rules. |
boolean |
isExtending()
Get extends flag. |
boolean |
isProcessed()
Whether or not the this Form was processed for replacing
variables in strings with their values. |
protected void |
merge(Form depends)
Merges the given form into this one. |
protected void |
process(Map globalConstants,
Map constants,
Map forms)
Processes all of the Form 's Field s. |
void |
setExtends(String inherit)
Sets the name/key of the parent set of validation rules. |
void |
setName(String name)
Sets the name/key of the set of validation rules. |
String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String name
protected List lFields
Field
s. Used to maintain the order they were added
in although individual Field
s can be retrieved using Map
of Field
s.
protected org.apache.commons.collections.FastHashMap hFields
Field
s keyed on their property value.
protected String inherit
Constructor Detail |
---|
public Form()
Method Detail |
---|
public String getName()
public void setName(String name)
name
- The new name valuepublic void addField(Field f)
Field
to the Form
.
f
- The fieldpublic List getFields()
List
of Field
s is returned as an unmodifiable
List
.
public Field getField(String fieldName)
fieldName
- The field name
public boolean containsField(String fieldName)
fieldName
- The field name
protected void merge(Form depends)
depends
not present in this form, include it. depends
has precedence
in the way the fields are ordered.
depends
- the form we want to mergeprotected void process(Map globalConstants, Map constants, Map forms)
Form
's Field
s.
globalConstants
- A map of global constantsconstants
- Local constantsforms
- Map of formspublic String toString()
toString
in class Object
public boolean isProcessed()
Form
was processed for replacing
variables in strings with their values.
public String getExtends()
public void setExtends(String inherit)
inherit
- The new extends valuepublic boolean isExtending()
protected Map getFieldMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |