Commons Resources (Unofficial)
|
- All Implemented Interfaces:
- java.io.Serializable
- public class ValidatorResources
- extends java.lang.Object
- implements java.io.Serializable
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 ValidatorAction s 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 FormSet s stored under
a Locale key. |
protected static org.apache.commons.logging.Log |
log
Logger. |
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 ValidatorAction s. |
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 |
protected static org.apache.commons.logging.Log
- Logger.
protected org.apache.commons.collections.FastHashMap
FastHashMap of FormSet s stored under
a Locale key.
protected org.apache.commons.collections.FastHashMap
FastHashMap of global constant values with
the name of the constant as the key.
protected org.apache.commons.collections.FastHashMap
FastHashMap of ValidatorAction s with
the name of the ValidatorAction as the key.
protected static java.util.Locale
- The default locale on our server.
- Add a
FormSet to this ValidatorResources
object. It will be associated with the Locale of the
FormSet .
- Add a global constant to the resource.
public void (java.lang.String name,
java.lang.String value)
- Add a global constant to the resource.
Add a ValidatorAction to the resource. It also creates an instance
of the class based on the ValidatorAction s classname and retrieves
the Method instance and sets them in the ValidatorAction .
public (java.lang.String key)
- Get a
ValidatorAction based on it's name.
- Get an unmodifiable
Map of the ValidatorAction s.
protected java.lang.String ( fs)
- Builds a key to store the
FormSet under based on it's language, country,
and variant values.
public (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:
- language + country + variant
- language + country
- language
- default locale
public (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:
- language + country + variant
- language + country
- language
- default locale
Process the ValidatorResources object.
Currently sets the FastHashMap s to the 'fast'
mode and call the processes all other resources.
Process the Form objects. This clones the Field s
that don't exist in a FormSet compared to the default
FormSet .
protected ( fs,
java.lang.String formKey,
java.lang.String fieldKey)
- Retrieves the closest matching
Field based
on FormSet 's locale. This is used when
constructing a clone, field by field, of partial
FormSet .
Copyright (c) 2001-2002 - Apache Software Foundation
|