org.apache.struts.validator
クラス DynaValidatorForm

java.lang.Object
  拡張org.apache.struts.action.ActionForm
      拡張org.apache.struts.action.DynaActionForm
          拡張org.apache.struts.validator.DynaValidatorForm
すべての実装インタフェース:
org.apache.commons.beanutils.DynaBean, java.io.Serializable
直系の既知のサブクラス:
DynaValidatorActionForm

public class DynaValidatorForm
extends DynaActionForm
implements org.apache.commons.beanutils.DynaBean, java.io.Serializable

This class extends DynaActionForm and provides basic field validation based on an XML file. The key passed into the validator is the action element's 'name' attribute from the struts-config.xml which should match the form element's name attribute in the validation.xml.

導入されたバージョン:
Struts 1.1
バージョン:
$Revision: 1.1 $ $Date: 2004/10/20 03:26:41 $
関連項目:
ActionForm, 直列化された形式

フィールドの概要
private static org.apache.commons.logging.Log log
          Commons Logging instance.
protected  int page
          Used to indicate the current page of a multi-page form.
protected  org.apache.commons.validator.ValidatorResults validatorResults
          The results returned from the validation performed by the Validator.
 
クラス org.apache.struts.action.DynaActionForm から継承したフィールド
dynaClass, dynaValues
 
クラス org.apache.struts.action.ActionForm から継承したフィールド
multipartRequestHandler, servlet
 
コンストラクタの概要
DynaValidatorForm()
           
 
メソッドの概要
 int getPage()
          Gets page.
 java.util.Map getResultValueMap()
          Returns a Map of values returned from any validation that returns a value other than null or Boolean with the key the full property path of the field.
 java.lang.String getValidationKey(ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Returns the Validation key.
 org.apache.commons.validator.ValidatorResults getValidatorResults()
          Get results of the validation performed by the Validator.
 void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Reset all properties to their default values.
 void setPage(int page)
          Sets page.
protected  void setPageFromDynaProperty()
          Sets this.page to the value of the Dyna property "page" if it's defined.
 void setValidatorResults(org.apache.commons.validator.ValidatorResults validatorResults)
          Set results of the validation performed by the Validator.
 ActionErrors validate(ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Validate the properties that have been set from this HTTP request, and return an ActionErrors object that encapsulates any validation errors that have been found.
 
クラス org.apache.struts.action.DynaActionForm から継承したメソッド
contains, get, get, get, getDynaClass, getDynaProperty, getMap, getString, getStrings, initialize, initialize, isDynaAssignable, remove, reset, set, set, set, toString
 
クラス org.apache.struts.action.ActionForm から継承したメソッド
getMultipartRequestHandler, getServlet, getServletWrapper, setMultipartRequestHandler, setServlet, validate
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース org.apache.commons.beanutils.DynaBean から継承したメソッド
contains, get, get, get, getDynaClass, remove, set, set, set
 

フィールドの詳細

log

private static org.apache.commons.logging.Log log
Commons Logging instance.


validatorResults

protected org.apache.commons.validator.ValidatorResults validatorResults
The results returned from the validation performed by the Validator.


page

protected int page
Used to indicate the current page of a multi-page form.

コンストラクタの詳細

DynaValidatorForm

public DynaValidatorForm()
メソッドの詳細

getPage

public int getPage()
Gets page.

戻り値:
page number.

setPage

public void setPage(int page)
Sets page.

パラメータ:
page - page number

validate

public ActionErrors validate(ActionMapping mapping,
                             javax.servlet.http.HttpServletRequest request)
Validate the properties that have been set from this HTTP request, and return an ActionErrors object that encapsulates any validation errors that have been found. If no errors are found, return null or an ActionErrors object with no recorded error messages.

オーバーライド:
クラス ActionForm 内の validate
パラメータ:
mapping - The mapping used to select this instance.
request - The servlet request we are processing.
戻り値:
ActionErrors object that encapsulates any validation errors.
関連項目:
DynaActionForm

getValidationKey

public java.lang.String getValidationKey(ActionMapping mapping,
                                         javax.servlet.http.HttpServletRequest request)
Returns the Validation key.

パラメータ:
mapping - The mapping used to select this instance
request - The servlet request we are processing
戻り値:
validation key - the form element's name in this case

setPageFromDynaProperty

protected void setPageFromDynaProperty()
Sets this.page to the value of the Dyna property "page" if it's defined. This is used to setup the page variable before validation starts.

導入されたバージョン:
Struts 1.2

reset

public void reset(ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request)
Reset all properties to their default values.

オーバーライド:
クラス DynaActionForm 内の reset
パラメータ:
mapping - The mapping used to select this instance
request - The servlet request we are processing

getValidatorResults

public org.apache.commons.validator.ValidatorResults getValidatorResults()
Get results of the validation performed by the Validator.

戻り値:
validator results as ValidatorResults object

setValidatorResults

public void setValidatorResults(org.apache.commons.validator.ValidatorResults validatorResults)
Set results of the validation performed by the Validator.

パラメータ:
validatorResults - Set results of the validation performed

getResultValueMap

public java.util.Map getResultValueMap()
Returns a Map of values returned from any validation that returns a value other than null or Boolean with the key the full property path of the field.

戻り値:
Returns a Map of values, otherwise returns null if no results.


このドキュメントは、Ja-Jakartaにより訳されました。コメントがある場合は、report@jajakarta.orgまでお願いします。
Copyright (C) 2000-2004 - Apache Software Foundation