org.iscreen.ognl.validators
Class ExpressionValidator

java.lang.Object
  extended by org.iscreen.BaseValidator
      extended by org.iscreen.ognl.validators.ExpressionValidator
All Implemented Interfaces:
Validator

public class ExpressionValidator
extends BaseValidator

The ExpressionValidator uses an ONGL expression to check an object (the OGNL root). If the expression returns false, then it's considered a failure.

Author:
Shellman, Dan

Field Summary
protected  java.lang.String expression
           
 
Fields inherited from class org.iscreen.BaseValidator
defaultFailure
 
Constructor Summary
ExpressionValidator()
          Default constructor.
 
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 org.iscreen.BaseValidator
constructBeanToValidate, getDefaultFailure, getStringValue, getValue, setDefaultFailure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expression

protected java.lang.String expression
Constructor Detail

ExpressionValidator

public ExpressionValidator()
Default constructor.

Method Detail

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()