org.apache.commons.validator
クラス Field

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

public class Field
extends Object
implements Cloneable, Serializable

フィールドに対して行う妥当性チェックとエラーメッセージの生成に使用する 入れ替え可能な妥当性チェックのリストとメッセージの情報と値を内部に持ちます。

This contains the list of pluggable validators to run on a field and any message information and variables to perform the validations and generate error messages.

バージョン:
$Revision: 1.1.1.1 $ $Date: 2004/02/13 10:02:01 $
作成者:
David Winterfeldt
関連項目:
Form, 直列化された形式
翻訳者:
日置 聡
翻訳状況:
中断(訳者募集中)
翻訳更新日:
2003/07/28

フィールドの概要
static String ARG_DEFAULT
          This is the value that will be used as a key if the Arg name field has no value.
protected  String depends
           
protected  int fieldOrder
           
protected  org.apache.commons.collections.FastHashMap hArg0
           
protected  org.apache.commons.collections.FastHashMap hArg1
           
protected  org.apache.commons.collections.FastHashMap hArg2
           
protected  org.apache.commons.collections.FastHashMap hArg3
           
protected  org.apache.commons.collections.FastHashMap hDependencies
           
protected  org.apache.commons.collections.FastHashMap hMsgs
           
protected  org.apache.commons.collections.FastHashMap hVars
           
protected  String indexedListProperty
           
protected  String indexedProperty
           
protected  String key
           
protected  int page
           
protected  String property
           
protected static String TOKEN_END
           
static String TOKEN_INDEXED
          This indicates an indexed property is being referenced.
protected static String TOKEN_START
           
protected static String TOKEN_VAR
           
 
コンストラクタの概要
Field()
           
 
メソッドの概要
 void addArg0(Arg arg)
          Add a Arg to the arg0 list.
 void addArg1(Arg arg)
          Add a Arg to the arg1 list.
 void addArg2(Arg arg)
          Add a Arg to the arg2 list.
 void addArg3(Arg arg)
          Add a Arg to the arg3 list.
 void addMsg(Msg msg)
          Add a Msg to the Field.
 void addVar(Var v)
          Add a Var to the Field.
 void addVarParam(String name, String value, String jsType)
          Add a Var, based on the values passed in, to the Field.
 Object clone()
          Creates and returns a copy of this object.
 void generateKey()
          Generate correct key value.
 Arg getArg0()
          Gets the default arg0 Arg object.
 Arg getArg0(String key)
          Gets the arg0 Arg object based on the key passed in.
 Arg getArg1()
          Gets the default arg1 Arg object.
 Arg getArg1(String key)
          Gets the arg1 Arg object based on the key passed in.
 Arg getArg2()
          Gets the default arg2 Arg object.
 Arg getArg2(String key)
          Gets the arg2 Arg object based on the key passed in.
 Arg getArg3()
          Gets the default arg3 Arg object.
 Arg getArg3(String key)
          Gets the arg3 Arg object based on the key passed in.
 Collection getDependencies()
          Gets an unmodifiable Set of the dependencies.
 String getDepends()
          Gets the validation rules for this field.
 int getFieldOrder()
          Gets the position of the Field in the validation list.
 String getIndexedListProperty()
          Gets the indexed property name of the field.
 String getIndexedProperty()
          Gets the indexed property name of the field.
 String getKey()
          Gets a unique key based on the property and indexedProperty fields.
 String getMsg(String key)
          Retrieve a message value.
 int getPage()
          Gets the page value that the Field is associated with for validation.
 String getProperty()
          Gets the property name of the field.
 Var getVar(String mainKey)
          Retrieve a variable.
 Map getVars()
          The Field's variables are returned as an unmodifiable Map.
 String getVarValue(String mainKey)
          Retrieve a variable's value.
 boolean isDependency(String key)
          Checks if the key is listed as a dependency.
 boolean isIndexed()
          If there is a value specified for the indexedProperty field then true will be returned.
 void process(Map globalConstants, Map constants)
          Replace constants with values in fields and process the depends field to create the dependency Map.
private  void processArg(Map hArgs, String key, String replaceValue)
          Replace the arg Collection key value with the key/value pairs passed in.
 void processMessageComponents(String key, String replaceValue)
          Replace the args key value with the key/value pairs passed in.
private  void processVars(String key, String replaceValue)
          Replace the vars value with the key/value pairs passed in.
 void setDepends(String depends)
          Sets the validation rules for this field.
 void setFieldOrder(int fieldOrder)
          Sets the position of the Field in the validation list.
 void setIndexedListProperty(String indexedListProperty)
          Sets the indexed property name of the field.
 void setIndexedProperty(String indexedProperty)
          Sets the indexed property name of the field.
 void setKey(String key)
          Sets a unique key for the field.
 void setPage(int page)
          Sets the page value that the Field is associated with for validation.
 void setProperty(String property)
          Sets the property name of the field.
 String toString()
          Returns a string representation of the object.
 
クラス java.lang.Object から継承したメソッド
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

ARG_DEFAULT

public static final String ARG_DEFAULT
This is the value that will be used as a key if the Arg name field has no value.

関連項目:
定数フィールド値

TOKEN_INDEXED

public static final String TOKEN_INDEXED
This indicates an indexed property is being referenced.

関連項目:
定数フィールド値

TOKEN_START

protected static final String TOKEN_START
関連項目:
定数フィールド値

TOKEN_END

protected static final String TOKEN_END
関連項目:
定数フィールド値

TOKEN_VAR

protected static final String TOKEN_VAR
関連項目:
定数フィールド値

property

protected String property

indexedProperty

protected String indexedProperty

indexedListProperty

protected String indexedListProperty

key

protected String key

depends

protected String depends

page

protected int page

fieldOrder

protected int fieldOrder

hDependencies

protected org.apache.commons.collections.FastHashMap hDependencies

hVars

protected org.apache.commons.collections.FastHashMap hVars

hMsgs

protected org.apache.commons.collections.FastHashMap hMsgs

hArg0

protected org.apache.commons.collections.FastHashMap hArg0

hArg1

protected org.apache.commons.collections.FastHashMap hArg1

hArg2

protected org.apache.commons.collections.FastHashMap hArg2

hArg3

protected org.apache.commons.collections.FastHashMap hArg3
コンストラクタの詳細

Field

public Field()
メソッドの詳細

getPage

public int getPage()
Gets the page value that the Field is associated with for validation.


setPage

public void setPage(int page)
Sets the page value that the Field is associated with for validation.


getFieldOrder

public int getFieldOrder()
Gets the position of the Field in the validation list.


setFieldOrder

public void setFieldOrder(int fieldOrder)
Sets the position of the Field in the validation list.


getProperty

public String getProperty()
Gets the property name of the field.


setProperty

public void setProperty(String property)
Sets the property name of the field.


getIndexedProperty

public String getIndexedProperty()
Gets the indexed property name of the field. This is the method name that can take an int as a parameter for indexed property value retrieval.


setIndexedProperty

public void setIndexedProperty(String indexedProperty)
Sets the indexed property name of the field.


getIndexedListProperty

public String getIndexedListProperty()
Gets the indexed property name of the field. This is the method name that will return an array or a Collection used to retrieve the list and then loop through the list performing the specified validations.


setIndexedListProperty

public void setIndexedListProperty(String indexedListProperty)
Sets the indexed property name of the field.


getDepends

public String getDepends()
Gets the validation rules for this field.


setDepends

public void setDepends(String depends)
Sets the validation rules for this field.


addMsg

public void addMsg(Msg msg)
Add a Msg to the Field.


getMsg

public String getMsg(String key)
Retrieve a message value.


addArg0

public void addArg0(Arg arg)
Add a Arg to the arg0 list.


getArg0

public Arg getArg0()
Gets the default arg0 Arg object.


getArg0

public Arg getArg0(String key)
Gets the arg0 Arg object based on the key passed in. If the key finds a null value then the default value will try to be retrieved.


addArg1

public void addArg1(Arg arg)
Add a Arg to the arg1 list.


getArg1

public Arg getArg1()
Gets the default arg1 Arg object.


getArg1

public Arg getArg1(String key)
Gets the arg1 Arg object based on the key passed in. If the key finds a null value then the default value will try to be retrieved.


addArg2

public void addArg2(Arg arg)
Add a Arg to the arg2 list.


getArg2

public Arg getArg2()
Gets the default arg2 Arg object.


getArg2

public Arg getArg2(String key)
Gets the arg2 Arg object based on the key passed in. If the key finds a null value then the default value will try to be retrieved.


addArg3

public void addArg3(Arg arg)
Add a Arg to the arg3 list.


getArg3

public Arg getArg3()
Gets the default arg3 Arg object.


getArg3

public Arg getArg3(String key)
Gets the arg3 Arg object based on the key passed in. If the key finds a null value then the default value will try to be retrieved.


addVar

public void addVar(Var v)
Add a Var to the Field.


addVarParam

public void addVarParam(String name,
                        String value,
                        String jsType)
Add a Var, based on the values passed in, to the Field.


getVar

public Var getVar(String mainKey)
Retrieve a variable.


getVarValue

public String getVarValue(String mainKey)
Retrieve a variable's value.


getVars

public Map getVars()
The Field's variables are returned as an unmodifiable Map.


getKey

public String getKey()
Gets a unique key based on the property and indexedProperty fields.


setKey

public void setKey(String key)
Sets a unique key for the field. This can be used to change the key temporarily to have a unique key for an indexed field.


isIndexed

public boolean isIndexed()
If there is a value specified for the indexedProperty field then true will be returned. Otherwise it will be false.


generateKey

public void generateKey()
Generate correct key value.


process

public void process(Map globalConstants,
                    Map constants)
Replace constants with values in fields and process the depends field to create the dependency Map.


processVars

private void processVars(String key,
                         String replaceValue)
Replace the vars value with the key/value pairs passed in.


processMessageComponents

public void processMessageComponents(String key,
                                     String replaceValue)
Replace the args key value with the key/value pairs passed in.


processArg

private void processArg(Map hArgs,
                        String key,
                        String replaceValue)
Replace the arg Collection key value with the key/value pairs passed in.


isDependency

public boolean isDependency(String key)
Checks if the key is listed as a dependency.


getDependencies

public Collection getDependencies()
Gets an unmodifiable Set of the dependencies.


clone

public Object clone()
Creates and returns a copy of this object.


toString

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



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