com.opensymphony.xwork.validator
Class AbstractActionValidatorManager
java.lang.Object
com.opensymphony.xwork.validator.AbstractActionValidatorManager
- All Implemented Interfaces:
- ActionValidatorManager
- Direct Known Subclasses:
- DefaultActionValidatorManager
public abstract class AbstractActionValidatorManager - extends Object
- implements ActionValidatorManager
An abstract implementation of ActionValidatorManager interface that contains the logics of
validating action objects and utlity methods common to all subclass eg. method to build validator
key ( buildValidatorKey(Class, String) ) that subclass will be interested in when eg.
saving the ValidatorConfig in a Map cache.
This class could serves as the base class for example DefaultActionValidatorManager
which reads in the validation configuration information through <action-class-name>-<action-alias>-validation.xml or
<action-class-name>-validation.xml xml file format or a custom ActionValidatorManager
that reads in the validation configuration through annotation where the diference between them is just how to get
the validation configuration information (in this example, through xml and annotation respectively).
- Version:
- $Date$ $Id$
- Author:
- tmjee
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractActionValidatorManager
public AbstractActionValidatorManager()
validate
public void validate(Object object,
String context)
throws ValidationException
- Validates the given object using action and its context.
- Specified by:
validate in interface ActionValidatorManager
- Parameters:
object - the action to validate.context - the action's context.
- Throws:
ValidationException - if an error happens when validating the action.
validate
public void validate(Object object,
String context,
ValidatorContext validatorContext)
throws ValidationException
- Validates an action give its context and a validation context.
- Specified by:
validate in interface ActionValidatorManager
- Parameters:
object - the action to validate.context - the action's context.validatorContext -
- Throws:
ValidationException - if an error happens when validating the action.
validate
public void validate(Object object,
List validators,
ValidatorContext validatorContext)
throws ValidationException
- Validates an action through a series of
validators with
the given validatorContext
- Specified by:
validate in interface ActionValidatorManager
- Parameters:
object - validators - validatorContext -
- Throws:
ValidationException
buildValidatorKey
protected String buildValidatorKey(Class clazz,
String context)
- Builds a key for validators - used when caching validators.
- Parameters:
clazz - the action.context - the action's context.
- Returns:
- a validator key which is the class name plus context.
buildValidatorsFromValidatorConfig
protected List buildValidatorsFromValidatorConfig(List validatorConfigs)
|