|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork.validator.validators.ValidatorSupport
public abstract class ValidatorSupport
Abstract implementation of the Validator interface suitable for subclassing.
Field Summary | |
---|---|
protected String |
defaultMessage
|
protected org.apache.commons.logging.Log |
log
|
protected String |
messageKey
|
Constructor Summary | |
---|---|
ValidatorSupport()
|
Method Summary | |
---|---|
protected void |
addActionError(Object object)
|
protected void |
addFieldError(String propertyName,
Object object)
|
protected Object |
conditionalParse(String expression)
Parse expression passed in against value stack. |
String |
getDefaultMessage()
|
protected Object |
getFieldValue(String name,
Object object)
Return the field value named name from object ,
object should have the appropriate getter/setter. |
String |
getMessage(Object object)
|
String |
getMessageKey()
|
String[] |
getMessageParameters()
|
boolean |
getParse()
|
ValidatorContext |
getValidatorContext()
|
String |
getValidatorType()
|
boolean |
isShortCircuit()
Gets whether this field validator should short circuit the validator queue it's in if validation fails. |
void |
setDefaultMessage(String message)
|
void |
setMessageKey(String key)
|
void |
setMessageParameters(String[] messageParameters)
|
void |
setParse(boolean parse)
|
void |
setShortCircuit(boolean shortcircuit)
Sets whether this field validator should short circuit the validator queue it's in if validation fails. |
void |
setValidatorContext(ValidatorContext validatorContext)
This method will be called before validate with a non-null ValidatorContext. |
void |
setValidatorType(String type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.opensymphony.xwork.validator.Validator |
---|
validate |
Field Detail |
---|
protected final org.apache.commons.logging.Log log
protected String defaultMessage
protected String messageKey
Constructor Detail |
---|
public ValidatorSupport()
Method Detail |
---|
public void setParse(boolean parse)
public boolean getParse()
public void setDefaultMessage(String message)
setDefaultMessage
in interface Validator
public String getDefaultMessage()
getDefaultMessage
in interface Validator
public String getMessage(Object object)
getMessage
in interface Validator
public void setMessageKey(String key)
setMessageKey
in interface Validator
public String getMessageKey()
getMessageKey
in interface Validator
public void setMessageParameters(String[] messageParameters)
setMessageParameters
in interface Validator
public String[] getMessageParameters()
getMessageParameters
in interface Validator
public void setShortCircuit(boolean shortcircuit)
ShortCircuitableValidator
setShortCircuit
in interface ShortCircuitableValidator
shortcircuit
- true if this field validator should short circuit on
failure, false otherwisepublic boolean isShortCircuit()
ShortCircuitableValidator
isShortCircuit
in interface ShortCircuitableValidator
public void setValidatorContext(ValidatorContext validatorContext)
Validator
setValidatorContext
in interface Validator
public ValidatorContext getValidatorContext()
getValidatorContext
in interface Validator
public void setValidatorType(String type)
setValidatorType
in interface Validator
public String getValidatorType()
getValidatorType
in interface Validator
protected Object conditionalParse(String expression)
expression
passed in against value stack. Only parse
when 'parse' param is set to true, else just returns the expression unparsed.
expression
-
protected Object getFieldValue(String name, Object object) throws ValidationException
name
from object
,
object
should have the appropriate getter/setter.
name
- object
-
ValidationException
protected void addActionError(Object object)
protected void addFieldError(String propertyName, Object object)
|
WebWork Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |