net.sourceforge.stripes.validation.expression
Class Jsp21ExpressionExecutor

java.lang.Object
  extended by net.sourceforge.stripes.validation.expression.Jsp21ExpressionExecutor
All Implemented Interfaces:
ExpressionExecutor

public class Jsp21ExpressionExecutor
extends Object
implements ExpressionExecutor

An implementation of ExpressionExecutor that uses the new EL API available in Java EE 5 in the javax.el package. While more complicated that the JSP 2.0 API it has one advantage which is that it can be used without the need to allocate a PageContext object and without any other libraries being available.

Since:
Stripes 1.5
Author:
tfenne

Nested Class Summary
protected static class Jsp21ExpressionExecutor.StripesELContext
          Implementation of the EL interface for managing expression context.
protected static class Jsp21ExpressionExecutor.StripesELResolver
          Implementation of the EL interface to resolve variables.
 
Field Summary
 
Fields inherited from interface net.sourceforge.stripes.validation.expression.ExpressionExecutor
ERROR_DEFAULT_SCOPE, ERROR_KEY, THIS
 
Constructor Summary
Jsp21ExpressionExecutor()
          Default constructor that throws an exception if the JSP2.1 APIs are not available.
 
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  ExpressionFactory getExpressionFactory()
          Creates an ExpressionFactory using the JspApplicationContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jsp21ExpressionExecutor

public Jsp21ExpressionExecutor()
Default constructor that throws an exception if the JSP2.1 APIs are not available.

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

getExpressionFactory

protected ExpressionFactory getExpressionFactory()
Creates an ExpressionFactory using the JspApplicationContext.



? Copyright 2005-2006, Stripes Development Team.