public class FormSet extends Object implements Serializable
Forms stored associated with a Locale
based on the country, language, and variant specified. Instances of this
class are configured with a <formset> xml element.| Modifier and Type | Field and Description |
|---|---|
protected static int |
COUNTRY_FORMSET
This is the type of
FormSets where only language and country
locale are specified. |
protected static int |
GLOBAL_FORMSET
This is the type of
FormSets where no locale is specified. |
protected static int |
LANGUAGE_FORMSET
This is the type of
FormSets where only language locale is
specified. |
protected static int |
VARIANT_FORMSET
This is the type of
FormSets where full locale has been set. |
| Constructor and Description |
|---|
FormSet() |
| Modifier and Type | Method and Description |
|---|---|
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<String,Form> |
getForms()
A
Map of Forms 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. |
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 |
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.
|
protected static final int GLOBAL_FORMSET
FormSets where no locale is specified.protected static final int LANGUAGE_FORMSET
FormSets where only language locale is
specified.protected static final int COUNTRY_FORMSET
FormSets where only language and country
locale are specified.protected static final int VARIANT_FORMSET
FormSets where full locale has been set.protected boolean isMerged()
protected int getType()
FormSet:GLOBAL_FORMSET,
LANGUAGE_FORMSET,COUNTRY_FORMSET or VARIANT_FORMSET
.NullPointerException - if there is inconsistency in the locale
definition (not sure about this)protected void merge(FormSet depends)
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.depends - FormSet to be mergedpublic boolean isProcessed()
FormSet was processed for replacing
variables in strings with their values.public String getLanguage()
Locale.public void setLanguage(String language)
Locale.language - The new language valuepublic String getCountry()
Locale.public void setCountry(String country)
Locale.country - The new country valuepublic String getVariant()
Locale.public void setVariant(String variant)
Locale.variant - The new variant valuepublic void addConstant(String name, String value)
Constant to the locale level.name - The constant namevalue - The constant valuepublic void addForm(Form f)
Form to the FormSet.f - The formpublic Form getForm(String formName)
Form based on the form name.formName - The form namepublic Map<String,Form> getForms()
Map of Forms is returned as an unmodifiable
Map with the key based on the form name.public String displayKey()
Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.