net.sourceforge.stripes.validation.expression
Class ExpressionExecutorSupport
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExpressionExecutorSupport
public ExpressionExecutorSupport()
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 validatedname
- the name of the field being validatedvalues
- the List of values (post type conversion), each to be validatedvalidationInfo
- the validation metadata for the fielderrors
- 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.