org.iscreen.mvel.validators
Class ExpressionValidator
java.lang.Object
org.iscreen.BaseValidator
org.iscreen.mvel.validators.ExpressionValidator
- All Implemented Interfaces:
- Validator
public class ExpressionValidator
- extends BaseValidator
The ExpressionValidator uses an MVEL expression to check
an object (the MVEL root). If the expression returns false,
then it's considered a failure.
- Author:
- Shellman, Dan
Field Summary |
protected java.lang.String |
expression
|
Method Summary |
java.lang.String |
getExpression()
|
void |
setExpression(java.lang.String exp)
|
void |
validate(ValidatorContext context,
java.lang.Object beanToValidate)
This is the method that's called to validate the "bean-to-validate."
Use the passed in ValidatorContext to report validation failures, etc. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
expression
protected java.lang.String expression
ExpressionValidator
public ExpressionValidator()
- Default constructor.
validate
public void validate(ValidatorContext context,
java.lang.Object beanToValidate)
- Description copied from interface:
Validator
- This is the method that's called to validate the "bean-to-validate."
Use the passed in ValidatorContext to report validation failures, etc.
The passed-in "bean-to-validate" is the same instance returned from
the call to constructBeanToValidate(), but with all of the appropriate
properties set (based upon the configured mapping).
- Parameters:
context
- The ValidatorContext, which is used to report failures.beanToValidate
- The JavaBean to validate.
setExpression
public void setExpression(java.lang.String exp)
getExpression
public java.lang.String getExpression()