|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.opensymphony.xwork2.validator.DefaultActionValidatorManager
public class DefaultActionValidatorManager
This is the entry point into XWork's rule-based validation framework.
Validation rules are specified in XML configuration files namedclassName-contextName-validation.xml
where
className is the name of the class the configuration is for and -contextName is optional
(contextName is an arbitrary key that is used to look up additional validation rules for a
specific context).
Nested Class Summary | |
---|---|
protected class |
DefaultActionValidatorManager.InternalValidatorContextWrapper
An ValidatorContext wrapper that
returns the full field name
DefaultActionValidatorManager.InternalValidatorContextWrapper.getFullFieldName(String)
by consulting it's parent if its an VisitorFieldValidator.AppendingValidatorContext . |
Field Summary | |
---|---|
protected static String |
VALIDATION_CONFIG_SUFFIX
The file suffix for any validation file. |
Constructor Summary | |
---|---|
DefaultActionValidatorManager()
|
Method Summary | |
---|---|
protected static String |
buildValidatorKey(Class clazz,
String context)
Builds a key for validators - used when caching validators. |
List<Validator> |
getValidators(Class clazz,
String context)
Returns a list of validators for the given class and context. |
List<Validator> |
getValidators(Class clazz,
String context,
String method)
Returns a list of validators for the given class, context, and method. |
void |
setValidatorFactory(ValidatorFactory fac)
|
void |
setValidatorFileParser(ValidatorFileParser parser)
|
void |
validate(Object object,
String context)
Validates the given object using action and its context. |
void |
validate(Object object,
String context,
String method)
Validates the given object using an action, its context, and the name of the method being invoked on the action. |
void |
validate(Object object,
String context,
ValidatorContext validatorContext)
Validates an action give its context and a validation context. |
void |
validate(Object object,
String context,
ValidatorContext validatorContext,
String method)
Validates an action give its context and a validation context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String VALIDATION_CONFIG_SUFFIX
Constructor Detail |
---|
public DefaultActionValidatorManager()
Method Detail |
---|
public void setValidatorFileParser(ValidatorFileParser parser)
public void setValidatorFactory(ValidatorFactory fac)
public List<Validator> getValidators(Class clazz, String context)
ActionValidatorManager
getValidators
in interface ActionValidatorManager
clazz
- the class to lookup.context
- the context of the action class - can be null.
public List<Validator> getValidators(Class clazz, String context, String method)
ActionValidatorManager
getValidators
in interface ActionValidatorManager
clazz
- the class to lookup.context
- the context of the action class - can be null.method
- the name of the method being invoked on the action - can be null.
public void validate(Object object, String context) throws ValidationException
ActionValidatorManager
validate
in interface ActionValidatorManager
object
- the action to validate.context
- the action's context.
ValidationException
- if an error happens when validating the action.public void validate(Object object, String context, String method) throws ValidationException
ActionValidatorManager
validate
in interface ActionValidatorManager
object
- the action to validate.context
- the action's context.method
- the name of the method being invoked on the action - can be null.
ValidationException
- if an error happens when validating the action.public void validate(Object object, String context, ValidatorContext validatorContext) throws ValidationException
ActionValidatorManager
validate
in interface ActionValidatorManager
object
- the action to validate.context
- the action's context.validatorContext
- the validation context to use
ValidationException
- if an error happens when validating the action.public void validate(Object object, String context, ValidatorContext validatorContext, String method) throws ValidationException
ActionValidatorManager
validate
in interface ActionValidatorManager
object
- the action to validate.context
- the action's context.validatorContext
- the validation context to usemethod
- the name of the method being invoked on the action - can be null.
ValidationException
- if an error happens when validating the action.protected static String buildValidatorKey(Class clazz, String context)
clazz
- the action.context
- the action's context.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |