public abstract class NuitonFieldValidatorSupport
extends com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
skip property that can be used to skip or
not the validator, this property is a OGNL expression.
To use this new field validator support, just now implements the method
validateWhenNotSkip(Object). This method will be invoked only if the skip
parameter is evaluated to false.| Modifier and Type | Field and Description |
|---|---|
protected String |
skip
extra parameter at the very beginning of the
validate(Object) method to be able to skip (or not) the
validator execution. |
| Constructor and Description |
|---|
NuitonFieldValidatorSupport() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
evaluateSkipParameter(Object object)
Evaluate the skip parameter value against the object to validate.
|
Object |
getFieldValue(String name,
Object object) |
void |
setSkip(String skip)
Sets the value of the
skip parameter. |
void |
validate(Object object) |
protected abstract void |
validateWhenNotSkip(Object object)
Method to be invoked when skip parameter was not evaludated to
true. |
getFieldName, getValidatorType, setFieldName, setValidatorTypeaddActionError, addFieldError, getDefaultMessage, getMessage, getMessageKey, getMessageParameters, getValidatorContext, isShortCircuit, parse, setDefaultMessage, setMessageKey, setMessageParameters, setShortCircuit, setValidatorContext, setValueStackprotected String skip
validate(Object) method to be able to skip (or not) the
validator execution.
by default the value is false : it seems fair to want to
validate if the validator is used :D...public void setSkip(String skip)
skip parameter.skip - the new value of the skip parameterprotected abstract void validateWhenNotSkip(Object object) throws com.opensymphony.xwork2.validator.ValidationException
true.object - the object to be validated.com.opensymphony.xwork2.validator.ValidationException - is thrown if there is validation error(s).public void validate(Object object) throws com.opensymphony.xwork2.validator.ValidationException
com.opensymphony.xwork2.validator.ValidationExceptionprotected boolean evaluateSkipParameter(Object object) throws com.opensymphony.xwork2.validator.ValidationException
object - the object to validatecom.opensymphony.xwork2.validator.ValidationException - if could not evaluate the parameterCopyright © 2013–2014 CodeLutin. All rights reserved.