|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.apache.commons.validator.ValidatorResources
General purpose class for storing FormSet objects based
on their associated Locale.
IMPLEMENTATION NOTE - Classes that extend this class must be Serializable so that instances may be used in distributable application server environments.
| Field Summary | |
protected static java.util.Locale |
defaultLocale
The default locale on our server. |
protected org.apache.commons.collections.FastHashMap |
hActions
FastHashMap of ValidatorActions with
the name of the ValidatorAction as the key. |
protected org.apache.commons.collections.FastHashMap |
hConstants
FastHashMap of global constant values with
the name of the constant as the key. |
protected org.apache.commons.collections.FastHashMap |
hFormSets
FastHashMap of FormSets stored under
a Locale key. |
protected static org.apache.commons.logging.Log |
log
Logger |
| Constructor Summary | |
ValidatorResources()
|
|
| Method Summary | |
void |
addConstant(Constant c)
Add a global constant to the resource. |
void |
addConstantParam(java.lang.String name,
java.lang.String value)
Add a global constant to the resource. |
void |
addValidatorAction(ValidatorAction va)
Add a ValidatorAction to the resource. |
protected java.lang.String |
buildKey(FormSet fs)
Builds a key to store the FormSet under based on it's language, country,
and variant values. |
Form |
get(java.util.Locale locale,
java.lang.Object formKey)
Gets a Form based on the name of the form and the Locale that
most closely matches the Locale passed in. |
Form |
get(java.lang.String language,
java.lang.String country,
java.lang.String variant,
java.lang.Object formKey)
Gets a Form based on the name of the form and the Locale that
most closely matches the Locale passed in. |
protected Field |
getClosestLocaleField(FormSet fs,
java.lang.String formKey,
java.lang.String fieldKey)
Retrieves the closest matching Field based
on FormSet's locale. |
ValidatorAction |
getValidatorAction(java.lang.String key)
Get a ValidatorAction based on it's name. |
java.util.Map |
getValidatorActions()
Get an unmodifiable Map of the ValidatorActions. |
void |
process()
Process the ValidatorResources object. |
void |
processForms()
Process the Form objects. |
void |
put(FormSet fs)
Add a FormSet to this ValidatorResources
object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static org.apache.commons.logging.Log log
protected org.apache.commons.collections.FastHashMap hFormSets
FastHashMap of FormSets stored under
a Locale key.
protected org.apache.commons.collections.FastHashMap hConstants
FastHashMap of global constant values with
the name of the constant as the key.
protected org.apache.commons.collections.FastHashMap hActions
FastHashMap of ValidatorActions with
the name of the ValidatorAction as the key.
protected static java.util.Locale defaultLocale
| Constructor Detail |
public ValidatorResources()
| Method Detail |
public void put(FormSet fs)
FormSet to this ValidatorResources
object. It will be associated with the Locale of the
FormSet.
public void addConstant(Constant c)
public void addConstantParam(java.lang.String name,
java.lang.String value)
public void addValidatorAction(ValidatorAction va)
Add a ValidatorAction to the resource. It also creates an instance
of the class based on the ValidatorActions classname and retrieves
the Method instance and sets them in the ValidatorAction.
public ValidatorAction getValidatorAction(java.lang.String key)
ValidatorAction based on it's name.
public java.util.Map getValidatorActions()
Map of the ValidatorActions.
protected java.lang.String buildKey(FormSet fs)
FormSet under based on it's language, country,
and variant values.
public Form get(java.util.Locale locale,
java.lang.Object formKey)
Gets a Form based on the name of the form and the Locale that
most closely matches the Locale passed in. The order of Locale
matching is:
public Form get(java.lang.String language,
java.lang.String country,
java.lang.String variant,
java.lang.Object formKey)
Gets a Form based on the name of the form and the Locale that
most closely matches the Locale passed in. The order of Locale
matching is:
public void process()
Process the ValidatorResources object.
Currently sets the FastHashMaps to the 'fast'
mode and call the processes all other resources.
public void processForms()
Process the Form objects. This clones the Fields
that don't exist in a FormSet compared to the default
FormSet.
protected Field getClosestLocaleField(FormSet fs,
java.lang.String formKey,
java.lang.String fieldKey)
Field based
on FormSet's locale. This is used when
constructing a clone, field by field, of partial
FormSet.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||