net.sourceforge.stripes.validation.expression
Class ExpressionExecutorSupport

java.lang.Object
  extended by net.sourceforge.stripes.validation.expression.ExpressionExecutorSupport
All Implemented Interfaces:
ExpressionExecutor
Direct Known Subclasses:
CommonsElExpressionExecutor, Jsp20ExpressionExecutor

public abstract class ExpressionExecutorSupport
extends Object
implements ExpressionExecutor

A base class that provides the general plumbing for running expression validation using the old JSP 2.0 style ExpressionEvaluator. Uses a custom VariableResolver to make fields of the ActionBean available in the expression.

Since:
Stripes 1.5
Author:
Tim Fennell

Nested Class Summary
protected static class ExpressionExecutorSupport.BeanVariableResolver
          A JSP EL VariableResolver that first attempts to look up the value of the variable as a first level property on the ActionBean, and if does not exist then delegates to the built in resolver.
 
Field Summary
 
Fields inherited from interface net.sourceforge.stripes.validation.expression.ExpressionExecutor
ERROR_DEFAULT_SCOPE, ERROR_KEY, THIS
 
Constructor Summary
ExpressionExecutorSupport()
           
 
Method Summary
 void evaluate(ActionBean bean, ParameterName name, List<Object> values, ValidationMetadata validationInfo, ValidationErrors errors)
          Performs validation of an ActionBean property using the expression contained within the validation metadata.
protected abstract  ExpressionEvaluator getEvaluator()
          Must be implemented by subclasses to return an instance of ExpressionEvaluator that can be used to execute expressions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionExecutorSupport

public ExpressionExecutorSupport()
Method Detail

evaluate

public void evaluate(ActionBean bean,
                     ParameterName name,
                     List<Object> values,
                     ValidationMetadata validationInfo,
                     ValidationErrors errors)
Description copied from interface: ExpressionExecutor
Performs validation of an ActionBean property using the expression contained within the validation metadata. If the expression does not evaluate to true then an error will be added to the validation errors. Otherwise there are no side effects.

Specified by:
evaluate in interface ExpressionExecutor
Parameters:
bean - the ActionBean instance owning the field being validated
name - the name of the field being validated
values - the List of values (post type conversion), each to be validated
validationInfo - the validation metadata for the field
errors - the ValidationErrors object into which to place any errors

getEvaluator

protected abstract ExpressionEvaluator getEvaluator()
Must be implemented by subclasses to return an instance of ExpressionEvaluator that can be used to execute expressions.

Returns:
a working ExpressionEvaluator implementation.


? Copyright 2005-2006, Stripes Development Team.