FileDocCategorySizeDatePackage
ExpressionEvaluatorImpl.javaAPI DocGlassfish v2 API8226Fri May 04 22:32:54 BST 2007org.apache.jasper.runtime

ExpressionEvaluatorImpl

public class ExpressionEvaluatorImpl extends javax.servlet.jsp.el.ExpressionEvaluator

This is the implementation of ExpreesioEvaluator using implementation of JSP2.1.

author
Kin-man Chung
version
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: tcfujii $

Fields Summary
private javax.servlet.jsp.PageContext
pageContext
Constructors Summary
public ExpressionEvaluatorImpl(javax.servlet.jsp.PageContext pageContext)
Constructor

        this.pageContext = pageContext;
    
Methods Summary
public java.lang.Objectevaluate(java.lang.String expression, java.lang.Class expectedType, javax.servlet.jsp.el.VariableResolver vResolver, javax.servlet.jsp.el.FunctionMapper fMapper)


        ELContextImpl elContext;
        if (vResolver instanceof VariableResolverImpl) {
            elContext = (ELContextImpl) pageContext.getELContext();
        }
        else {
            // The provided variable Resolver is a custom resolver,
            // wrap it with a ELResolver 
            elContext = new ELContextImpl(new ELResolverWrapper(vResolver));
        }

        javax.el.FunctionMapper fm = new FunctionMapperWrapper(fMapper);
        elContext.setFunctionMapper(fm);
        ExpressionFactory fac = ExpressionFactory.newInstance();
        Object value;
        try {
            ValueExpression expr = fac.createValueExpression(
                                 elContext,
                                 expression,
                                 expectedType);
            value = expr.getValue(elContext);
        } catch (javax.el.ELException ex) {
            throw new ELException(ex);
        }
        return value;
    
public javax.servlet.jsp.el.ExpressionparseExpression(java.lang.String expression, java.lang.Class expectedType, javax.servlet.jsp.el.FunctionMapper fMapper)


        ExpressionFactory fac = ExpressionFactory.newInstance();
        javax.el.ValueExpression expr;
        ELContextImpl elContext = new ELContextImpl(null);
        javax.el.FunctionMapper fm = new FunctionMapperWrapper(fMapper);
        elContext.setFunctionMapper(fm);
        try {
            expr = fac.createValueExpression(
                           elContext,
                           expression, expectedType);
        } catch (javax.el.ELException ex) {
            throw new ELException(ex);
        }
        return new ExpressionImpl(expr, pageContext);