org.apache.commons.validator
public class FormSet extends Object implements Serializable
Form
s stored associated with a Locale
based on the country, language, and variant specified. Instances of this
class are configured with a <formset> xml element.
Version: $Revision: 478334 $ $Date: 2006-11-22 21:31:54 +0000 (Wed, 22 Nov 2006) $
Field Summary | |
---|---|
Map | constants
A Map of Constant s using the name field of the
Constant as the key. |
String | country Country component of Locale (optional). |
protected static int | COUNTRY_FORMSET
This is the type of FormSet s where only language and country
locale are specified. |
Map | forms
A Map of Form s using the name field of the
Form as the key. |
protected static int | GLOBAL_FORMSET
This is the type of FormSet s where no locale is specified. |
String | language Language component of Locale (required). |
Log | log Logging |
protected static int | LANGUAGE_FORMSET
This is the type of FormSet s where only language locale is
specified. |
boolean | merged
Flag indicating if this formSet has been merged with its parent (higher
rank in Locale hierarchy). |
boolean | processed
Whether or not the this FormSet was processed for replacing
variables in strings with their values. |
String | variant Variant component of Locale (optional). |
protected static int | VARIANT_FORMSET
This is the type of FormSet s where full locale has been set. |
Method Summary | |
---|---|
void | addConstant(String name, String value)
Add a Constant to the locale level.
|
void | addForm(Form f)
Add a Form to the FormSet .
|
String | displayKey()
Returns a string representation of the object's key.
|
String | getCountry()
Gets the equivalent of the country component of Locale .
|
Form | getForm(String formName)
Retrieve a Form based on the form name.
|
Map | getForms()
A Map of Form s is returned as an unmodifiable
Map with the key based on the form name.
|
String | getLanguage()
Gets the equivalent of the language component of Locale .
|
Log | getLog()
Accessor method for Log instance.
|
protected int | getType()
Returns the type of FormSet :GLOBAL_FORMSET ,
LANGUAGE_FORMSET ,COUNTRY_FORMSET or VARIANT_FORMSET
.
|
String | getVariant()
Gets the equivalent of the variant component of Locale .
|
protected boolean | isMerged()
Has this formSet been merged?
|
boolean | isProcessed()
Whether or not the this FormSet was processed for replacing
variables in strings with their values.
|
protected void | merge(FormSet depends)
Merges the given FormSet into this one. |
void | process(Map globalConstants)
Processes all of the Form s.
|
void | setCountry(String country)
Sets the equivalent of the country component of Locale .
|
void | setLanguage(String language)
Sets the equivalent of the language component of Locale .
|
void | setVariant(String variant)
Sets the equivalent of the variant component of Locale .
|
String | toString()
Returns a string representation of the object.
|
Map
of Constant
s using the name field of the
Constant
as the key.Locale
(optional).FormSet
s where only language and country
locale are specified.Map
of Form
s using the name field of the
Form
as the key.FormSet
s where no locale is specified.Locale
(required).FormSet
s where only language locale is
specified.FormSet
was processed for replacing
variables in strings with their values.Locale
(optional).FormSet
s where full locale has been set.Constant
to the locale level.
Parameters: name The constant name value The constant value
Form
to the FormSet
.
Parameters: f The form
Returns: A string representation of the key
Locale
.
Returns: The country value
Form
based on the form name.
Parameters: formName The form name
Returns: The form
Map
of Form
s is returned as an unmodifiable
Map
with the key based on the form name.
Returns: The forms map
Locale
.
Returns: The language value
Returns: The Log instance.
FormSet
:GLOBAL_FORMSET
,
LANGUAGE_FORMSET
,COUNTRY_FORMSET
or VARIANT_FORMSET
.
Returns: The type value
Throws: NullPointerException if there is inconsistency in the locale definition (not sure about this)
Since: Validator 1.2.0
Locale
.
Returns: The variant value
Returns: true if it has been merged
Since: Validator 1.2.0
FormSet
was processed for replacing
variables in strings with their values.
Returns: The processed value
FormSet
into this one. If any of depends
s Forms
are not in this FormSet
then, include
them, else merge both Forms
. Theoretically we should only
merge a "parent" formSet.
Parameters: depends FormSet to be merged
Since: Validator 1.2.0
Form
s.
Parameters: globalConstants Global constants
Locale
.
Parameters: country The new country value
Locale
.
Parameters: language The new language value
Locale
.
Parameters: variant The new variant value
Returns: A string representation