jp.terasoluna.fw.web.struts.form
Class ValidatorActionFormEx

java.lang.Object
  extended by org.apache.struts.action.ActionForm
      extended by org.apache.struts.validator.ValidatorForm
          extended by org.apache.struts.validator.ValidatorActionForm
              extended by jp.terasoluna.fw.web.struts.form.ValidatorActionFormEx
All Implemented Interfaces:
java.io.Serializable, FormEx

public class ValidatorActionFormEx
extends org.apache.struts.validator.ValidatorActionForm
implements FormEx

Base class of Validator Framework supported ActionForm.

This is the actionform base class in which ValidatorActionForm of Struts is inherited.
Following is the configuration example of action form that inherits this class in Struts configuration file (struts-config.xml) .

Configuration example of action form in Struts configuration file (struts-config.xml)

 <form-beans>
  <form-bean
    name="_validateSampleForm"
    type="jp.terasoluna.sample.xxxx.SampleValidatorActionFormEx"
  >
  </form-bean>
 </form-beans>
 
Specify form name in name attribute of <form-bean> tag and class name in type attribute.
The uniqueness of form in the session is ensured by appending "_" in the beginning of the form name and specifying RequestProcessorEx in the controller.
Implementation example of form is shown below.

Implementation example of form

 public class SampleValidatorActionForm extends ValidatorActionFormEx {

    // Company ID
    private String companyId = null;
    // User ID
    private String userId = null;
    // Password
    private String password = null;
    ...
    // company ID setter
    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    // company ID getter 
    public String getCompanyId() {
        return companyId;
    }
    ...
 }
 
Creates the field of the information that needs to be retained in form and provides the description about the getter/setter of that field.

Functionality provided by extending this class

For the functionality related details, refer to the following:

See Also:
DynaValidatorActionFormEx, RequestProcessorEx, Resetter, ResetterPlugIn, FieldChecksEx, BLogicMapper, Serialized Form

Field Summary
private static org.apache.commons.logging.Log log
          Log class.
private  boolean modified
          Field value change flag.
private static long serialVersionUID
          Serial version ID.
 
Fields inherited from class org.apache.struts.validator.ValidatorForm
page, validatorResults
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
ValidatorActionFormEx()
           
 
Method Summary
 int getIndexCount(java.lang.String fieldName)
          Fetches the record count of specified field.
 java.lang.Object getIndexedValue(java.lang.String name, int index)
          Fetches the specified indexed property value.
 boolean isModified()
          Fetches field value change flag.
 void reset(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Resets the field value of action form.
 void setIndexedValue(java.lang.String name, int index, java.lang.Object value)
          Sets property value to the specified position of index.
 void setModified(boolean modified)
          Sets field value change flag.
 
Methods inherited from class org.apache.struts.validator.ValidatorActionForm
getValidationKey
 
Methods inherited from class org.apache.struts.validator.ValidatorForm
getPage, getResultValueMap, getValidatorResults, setPage, setValidatorResults, validate
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, setMultipartRequestHandler, setServlet, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version ID

See Also:
Constant Field Values

log

private static org.apache.commons.logging.Log log
Log class,


modified

private boolean modified
Field value change flag.

Constructor Detail

ValidatorActionFormEx

public ValidatorActionFormEx()
Method Detail

getIndexedValue

public java.lang.Object getIndexedValue(java.lang.String name,
                                        int index)
Fetches property value of specified index.

Specified by:
getIndexedValue in interface FormEx
Parameters:
name - Property name to be fetched
index - Index to be fetched
Returns:
Property value

getIndexCount

public int getIndexCount(java.lang.String fieldName)
Fetches the records of specified field.

Specified by:
getIndexCount in interface FormEx
Parameters:
fieldName - Field name for fetchign the records.
Returns:
Field value records.

Returns 0 when it is not possible to fetch the property name.


setIndexedValue

public void setIndexedValue(java.lang.String name,
                            int index,
                            java.lang.Object value)
Sets the property value to the specified position of index.

Specified by:
setIndexedValue in interface FormEx
Parameters:
name - Indexed property name to be set
index - Index position to be set
value - Property value to be set

isModified

public boolean isModified()
Fetches field value change flag.

Specified by:
isModified in interface FormEx
Returns:
Field value change flag

setModified

public void setModified(boolean modified)
Sets field value change flag.

Specified by:
setModified in interface FormEx
Parameters:
modified - Field value change flag

reset

public void reset(org.apache.struts.action.ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request)
Resets the field value of action form.

Overrides:
reset in class org.apache.struts.validator.ValidatorForm
Parameters:
mapping - Mapping information
request - Request information