org.apache.commons.validator
クラス ValidatorResources

java.lang.Object
  拡張org.apache.commons.validator.ValidatorResources
すべての実装インタフェース:
Serializable

public class ValidatorResources
extends Object
implements Serializable

Locale に関連した FormSet オブジェクトの保持を目的とするクラスです。

実装の注 - このインスタンスは分散されたアプリケーションサーバの環境で使用される可能性が高いため、 このクラスを継承するクラスは Serializable である必要があります。

バージョン:
$Revision: 1.1.1.1 $ $Date: 2004/02/13 10:02:01 $
作成者:
David Winterfeldt, David Graham
関連項目:
直列化された形式
翻訳者:
日置 聡

フィールドの概要
protected static 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.
 
コンストラクタの概要
ValidatorResources()
           
 
メソッドの概要
 void addConstant(Constant c)
          Add a global constant to the resource.
 void addConstantParam(String name, String value)
          Add a global constant to the resource.
 void addValidatorAction(ValidatorAction va)
          Add a ValidatorAction to the resource.
protected  String buildKey(FormSet fs)
          Builds a key to store the FormSet under based on it's language, country, and variant values.
 Form get(Locale locale, 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(String language, String country, String variant, 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, String formKey, String fieldKey)
          Retrieves the closest matching Field based on FormSet's locale.
 ValidatorAction getValidatorAction(String key)
          Get a ValidatorAction based on it's name.
 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.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

log

protected static org.apache.commons.logging.Log log
Logger.


hFormSets

protected org.apache.commons.collections.FastHashMap hFormSets
FastHashMap of FormSets stored under a Locale key.


hConstants

protected org.apache.commons.collections.FastHashMap hConstants
FastHashMap of global constant values with the name of the constant as the key.


hActions

protected org.apache.commons.collections.FastHashMap hActions
FastHashMap of ValidatorActions with the name of the ValidatorAction as the key.


defaultLocale

protected static Locale defaultLocale
The default locale on our server.

コンストラクタの詳細

ValidatorResources

public ValidatorResources()
メソッドの詳細

put

public void put(FormSet fs)
Add a FormSet to this ValidatorResources object. It will be associated with the Locale of the FormSet.


addConstant

public void addConstant(Constant c)
Add a global constant to the resource.


addConstantParam

public void addConstantParam(String name,
                             String value)
Add a global constant to the resource.


addValidatorAction

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.


getValidatorAction

public ValidatorAction getValidatorAction(String key)
Get a ValidatorAction based on it's name.


getValidatorActions

public Map getValidatorActions()
Get an unmodifiable Map of the ValidatorActions.


buildKey

protected String buildKey(FormSet fs)
Builds a key to store the FormSet under based on it's language, country, and variant values.


get

public Form get(Locale locale,
                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:

  1. language + country + variant
  2. language + country
  3. language
  4. default locale


get

public Form get(String language,
                String country,
                String variant,
                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:

  1. language + country + variant
  2. language + country
  3. language
  4. default locale


process

public void process()

Process the ValidatorResources object.

Currently sets the FastHashMaps to the 'fast' mode and call the processes all other resources.


processForms

public void processForms()

Process the Form objects. This clones the Fields that don't exist in a FormSet compared to the default FormSet.


getClosestLocaleField

protected Field getClosestLocaleField(FormSet fs,
                                      String formKey,
                                      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.



このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation