javax.servlet.jsp.el.FunctionMapper Java Examples

The following examples show how to use javax.servlet.jsp.el.FunctionMapper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExpressionEvaluatorImpl.java    From Tomcat8-Source-Read with MIT License 7 votes vote down vote up
@Override
public Expression parseExpression(String expression,
        @SuppressWarnings("rawtypes") Class expectedType,
        FunctionMapper fMapper) throws ELException {
    try {
        ELContextImpl ctx =
            new ELContextImpl(ELContextImpl.getDefaultResolver(factory));
        if (fMapper != null) {
            ctx.setFunctionMapper(new FunctionMapperImpl(fMapper));
        }
        ValueExpression ve = this.factory.createValueExpression(ctx, expression, expectedType);
        return new ExpressionImpl(ve, factory);
    } catch (javax.el.ELException e) {
        throw new ELParseException(e.getMessage());
    }
}
 
Example #2
Source File: ExpressionEvaluatorImpl.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
@Override
public Expression parseExpression(String expression,
        @SuppressWarnings("rawtypes") // API does not use generics
        Class expectedType,
        FunctionMapper fMapper) throws ELException {
    try {
        ELContextImpl ctx =
            new ELContextImpl(ELContextImpl.getDefaultResolver());
        if (fMapper != null) {
            ctx.setFunctionMapper(new FunctionMapperImpl(fMapper));
        }
        ValueExpression ve = this.factory.createValueExpression(ctx, expression, expectedType);
        return new ExpressionImpl(ve);
    } catch (javax.el.ELException e) {
        throw new ELParseException(e.getMessage());
    }
}
 
Example #3
Source File: ExpressionEvaluatorImpl.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
@Override
public Expression parseExpression(String expression,
        @SuppressWarnings("rawtypes") // API does not use generics
        Class expectedType,
        FunctionMapper fMapper) throws ELException {
    try {
        ELContextImpl ctx =
            new ELContextImpl(ELContextImpl.getDefaultResolver());
        if (fMapper != null) {
            ctx.setFunctionMapper(new FunctionMapperImpl(fMapper));
        }
        ValueExpression ve = this.factory.createValueExpression(ctx, expression, expectedType);
        return new ExpressionImpl(ve);
    } catch (javax.el.ELException e) {
        throw new ELParseException(e.getMessage());
    }
}
 
Example #4
Source File: ExpressionEvaluatorImpl.java    From packagedrone with Eclipse Public License 1.0 6 votes vote down vote up
public Expression parseExpression(String expression,
                                  Class expectedType,
                                  FunctionMapper fMapper )
        throws ELException {

    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);
}
 
Example #5
Source File: ExpressionEvaluatorImpl.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public Object evaluate(String expression,
        @SuppressWarnings("rawtypes") Class expectedType,
        VariableResolver vResolver, FunctionMapper fMapper)
        throws ELException {
    return this.parseExpression(expression, expectedType, fMapper).evaluate(vResolver);
}
 
Example #6
Source File: ExpressionEvaluatorImpl.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
public Object evaluate(String expression,
        @SuppressWarnings("rawtypes") // API does not use generics
        Class expectedType,
        VariableResolver vResolver, FunctionMapper fMapper)
        throws ELException {
    return this.parseExpression(expression, expectedType, fMapper).evaluate(vResolver);
}
 
Example #7
Source File: ExpressionEvaluatorImpl.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
public Object evaluate(String expression,
        @SuppressWarnings("rawtypes") // API does not use generics
        Class expectedType,
        VariableResolver vResolver, FunctionMapper fMapper)
        throws ELException {
    return this.parseExpression(expression, expectedType, fMapper).evaluate(vResolver);
}
 
Example #8
Source File: ExpressionEvaluatorImpl.java    From packagedrone with Eclipse Public License 1.0 5 votes vote down vote up
public Object evaluate(String expression,
                        Class expectedType,
                        VariableResolver vResolver,
                        FunctionMapper fMapper )
            throws ELException {

    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;
}
 
Example #9
Source File: FunctionMapperImpl.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
public FunctionMapperImpl(FunctionMapper fnMapper) {
    this.fnMapper = fnMapper;
}
 
Example #10
Source File: FunctionMapperImpl.java    From Tomcat7.0.67 with Apache License 2.0 4 votes vote down vote up
public FunctionMapperImpl(FunctionMapper fnMapper) {
    this.fnMapper = fnMapper;
}
 
Example #11
Source File: FunctionMapperImpl.java    From tomcatsrc with Apache License 2.0 4 votes vote down vote up
public FunctionMapperImpl(FunctionMapper fnMapper) {
    this.fnMapper = fnMapper;
}
 
Example #12
Source File: ExpressionEvaluatorImpl.java    From packagedrone with Eclipse Public License 1.0 4 votes vote down vote up
FunctionMapperWrapper(FunctionMapper mapper) {
    this.mapper = mapper;
}
 
Example #13
Source File: ExpressionEvaluator.java    From Benchmark with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Object evaluate(String arg0, Class arg1, VariableResolver arg2, FunctionMapper arg3) throws ELException {
	return null;
}
 
Example #14
Source File: ExpressionEvaluator.java    From Benchmark with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Expression parseExpression(String arg0, Class arg1, FunctionMapper arg2) throws ELException {
	return null;
}