org.apache.commons.validator

Class FormSet

Implemented Interfaces:
Serializable

public class FormSet
extends java.lang.Object
implements Serializable

Holds a set of 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.

Field Summary

private Map
constants
A Map of Constants using the name field of the Constant as the key.
private String
country
Country component of Locale (optional).
private Map
forms
A Map of Forms using the name field of the Form as the key.
private String
language
Language component of Locale (required).
private boolean
processed
Whether or not the this FormSet was processed for replacing variables in strings with their values.
private String
variant
Variant component of Locale (optional).

Method Summary

void
addConstant(String name, String value)
Add a Constant to the locale level.
void
addConstant(Constant c)
Deprecated. Use addConstant(String, String) instead.
void
addConstantParam(String name, String value)
Deprecated. Use addConstant(String, String) instead.
void
addForm(Form f)
Add a Form to the FormSet.
String
getCountry()
Gets the equivalent of the country component of Locale.
Form
getForm(Object key)
Deprecated. Use getForm(String) instead.
Form
getForm(String formName)
Retrieve a Form based on the form name.
Map
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.
String
getVariant()
Gets the equivalent of the variant component of Locale.
boolean
isProcessed()
Whether or not the this FormSet was processed for replacing variables in strings with their values.
void
process(Map globalConstants)
Deprecated. This method is called by the framework.
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.

Field Details

constants

private Map constants
A Map of Constants using the name field of the Constant as the key.


country

private String country
Country component of Locale (optional).


forms

private Map forms
A Map of Forms using the name field of the Form as the key.


language

private String language
Language component of Locale (required).


processed

private boolean processed
Whether or not the this FormSet was processed for replacing variables in strings with their values.


variant

private String variant
Variant component of Locale (optional).

Method Details

addConstant

public void addConstant(String name,
                        String value)
Add a Constant to the locale level.


addConstant

public void addConstant(Constant c)

Deprecated. Use addConstant(String, String) instead.

Add a Constant (locale level).


addConstantParam

public void addConstantParam(String name,
                             String value)

Deprecated. Use addConstant(String, String) instead.

Add a Constant to the locale level.


addForm

public void addForm(Form f)
Add a Form to the FormSet.


getCountry

public String getCountry()
Gets the equivalent of the country component of Locale.


getForm

public Form getForm(Object key)

Deprecated. Use getForm(String) instead.

Retrieve a Form based on the form name.


getForm

public Form getForm(String formName)
Retrieve a Form based on the form name.


getForms

public Map getForms()
A Map of Forms is returned as an unmodifiable Map with the key based on the form name.


getLanguage

public String getLanguage()
Gets the equivalent of the language component of Locale.


getVariant

public String getVariant()
Gets the equivalent of the variant component of Locale.


isProcessed

public boolean isProcessed()
Whether or not the this FormSet was processed for replacing variables in strings with their values.


process

public void process(Map globalConstants)

Deprecated. This method is called by the framework. It will be made protected in a future release. TODO

Processes all of the Forms.


setCountry

public void setCountry(String country)
Sets the equivalent of the country component of Locale.


setLanguage

public void setLanguage(String language)
Sets the equivalent of the language component of Locale.


setVariant

public void setVariant(String variant)
Sets the equivalent of the variant component of Locale.


toString

public String toString()
Returns a string representation of the object.


Copyright (c) 2001-2004 Apache Software Foundation