| org.apache.struts.validator.ValidatorForm org.apache.struts.validator.BeanValidatorForm
All known Subclasses: org.apache.struts.validator.LazyValidatorForm,
BeanValidatorForm | public class BeanValidatorForm extends ValidatorForm implements DynaBean,Serializable(Code) | | Struts validator ActionForm backed by either a
DynaBean or POJO JavaBean.
Passing a POJO JavaBean to the constructor will automatically create an
associated WrapDynaBean . One use for this would be to migrate
view objects from an existing system which, for the usual reasons,
can't be changed to extend .
This form is based on the standard struts ValidatorForm for
use with the Validator framework and validates either using the
name from the Struts ActionMapping or the
ActionMapping 's path depending on whether
pathValidation is true or
false .
Note: WrapDynaBean is NOT serializable. If you use this class
with a WrapDynaBean (as described above), you should not store your form in
session scope.
|
Field Summary | |
protected DynaBean | dynaBean The DynaBean that this ActionForm is backed by. | protected static Log | logger | protected boolean | pathValidation Indicates whether the ActionMapping's path should be used for the
validation key. |
Constructor Summary | |
public | BeanValidatorForm(Object bean) Construct a new BeanValidatorForm with the specified
bean. |
Method Summary | |
public boolean | contains(String name, String key) | public Object | get(String name) Return the value of a simple property with the specified name. | public Object | get(String name, int index) Return the value of an indexed property with the specified name. | public Object | get(String name, String key) Return the value of a mapped property with the specified name, or
null if there is no value for the specified key. | public DynaBean | getDynaBean() | public DynaClass | getDynaClass() Return the DynaClass instance that describes the set of
properties available for this DynaBean. | public Object | getInstance() Return the Bean that this ActionForm is
backed by.
If the DynaBean is a WrapDynaBean type
then this method returns the 'Wrapped' POJO bean associated with it. | public String | getStrutsConfigFormName() Return name used to identify the ActionForm in the
struts-config.xml. | public String | getValidationKey(ActionMapping mapping, HttpServletRequest request) | public void | initialize(FormBeanConfig formBeanConfig) | protected boolean | isPathValidation() | public void | remove(String name, String key) Remove any existing value for the specified key on the specified mapped
property. | public void | set(String name, Object value) Set the value of a simple property with the specified name. | public void | set(String name, int index, Object value) Set the value of an indexed property with the specified name. | public void | set(String name, String key, Object value) Set the value of a mapped property with the specified name. | protected void | setPathValidation(boolean pathValidation) | public int | size(String name) |
dynaBean | protected DynaBean dynaBean(Code) | | The DynaBean that this ActionForm is backed by.
|
logger | protected static Log logger(Code) | | Commons Logging
|
pathValidation | protected boolean pathValidation(Code) | | Indicates whether the ActionMapping's path should be used for the
validation key.
|
BeanValidatorForm | public BeanValidatorForm(Object bean)(Code) | | Construct a new BeanValidatorForm with the specified
bean.
|
contains | public boolean contains(String name, String key)(Code) | | Does the specified mapped property contain a value for the specified
key value?
Parameters: name - Name of the property to check Parameters: key - Name of the key to check |
get | public Object get(String name)(Code) | | Return the value of a simple property with the specified name.
Parameters: name - Name of the property whose value is to be retrieved |
get | public Object get(String name, int index)(Code) | | Return the value of an indexed property with the specified name.
Parameters: name - Name of the property whose value is to be retrieved Parameters: index - Index of the value to be retrieved |
get | public Object get(String name, String key)(Code) | | Return the value of a mapped property with the specified name, or
null if there is no value for the specified key.
Parameters: name - Name of the property whose value is to be retrieved Parameters: key - Key of the value to be retrieved |
getDynaBean | public DynaBean getDynaBean()(Code) | | Return the DynaBean that this ActionForm
is backed by.
|
getDynaClass | public DynaClass getDynaClass()(Code) | | Return the DynaClass instance that describes the set of
properties available for this DynaBean.
|
getInstance | public Object getInstance()(Code) | | Return the Bean that this ActionForm is
backed by.
If the DynaBean is a WrapDynaBean type
then this method returns the 'Wrapped' POJO bean associated with it. If
you require the actual WrapDynaBean then use the
getDynaBean() method.
|
getStrutsConfigFormName | public String getStrutsConfigFormName()(Code) | | Return name used to identify the ActionForm in the
struts-config.xml.
since: Struts 1.3.6 |
getValidationKey | public String getValidationKey(ActionMapping mapping, HttpServletRequest request)(Code) | | Returns the Validation key
Parameters: mapping - The mapping used to select this instance Parameters: request - The servlet request we are processing validation key to use |
initialize | public void initialize(FormBeanConfig formBeanConfig)(Code) | | Perform intialization of the ActionForm.
This method is called when the form is created.
since: Struts 1.3.6 |
isPathValidation | protected boolean isPathValidation()(Code) | | Indicates whether this form should validate based on the
ActionMapping 's path.
|
remove | public void remove(String name, String key)(Code) | | Remove any existing value for the specified key on the specified mapped
property.
Parameters: name - Name of the property for which a value is to be removed Parameters: key - Key of the value to be removed |
set | public void set(String name, Object value)(Code) | | Set the value of a simple property with the specified name.
Parameters: name - Name of the property whose value is to be set Parameters: value - Value to which this property is to be set |
set | public void set(String name, int index, Object value)(Code) | | Set the value of an indexed property with the specified name.
Parameters: name - Name of the property whose value is to be set Parameters: index - Index of the property to be set Parameters: value - Value to which this property is to be set |
set | public void set(String name, String key, Object value)(Code) | | Set the value of a mapped property with the specified name.
Parameters: name - Name of the property whose value is to be set Parameters: key - Key of the property to be set Parameters: value - Value to which this property is to be set |
setPathValidation | protected void setPathValidation(boolean pathValidation)(Code) | | Set whether this form should validate based on the
ActionMapping 's path.
|
size | public int size(String name)(Code) | | Return the size of an indexed or mapped property.
|
|
|