Search in sources :

Example 1 with ExpressionFactoryImpl

use of org.apache.el.ExpressionFactoryImpl in project tomcat70 by apache.

the class TestAttributeParser method evalAttr.

private String evalAttr(String expression, char quote) {
    ELContextImpl ctx = new ELContextImpl();
    ctx.setFunctionMapper(new TesterFunctions.FMapper());
    ExpressionFactoryImpl exprFactory = new ExpressionFactoryImpl();
    ValueExpression ve = exprFactory.createValueExpression(ctx, AttributeParser.getUnquoted(expression, quote, false, false, false, false), String.class);
    return (String) ve.getValue(ctx);
}
Also used : TesterFunctions(org.apache.el.TesterFunctions) ExpressionFactoryImpl(org.apache.el.ExpressionFactoryImpl) ValueExpression(javax.el.ValueExpression) ELContextImpl(org.apache.jasper.el.ELContextImpl)

Example 2 with ExpressionFactoryImpl

use of org.apache.el.ExpressionFactoryImpl in project tomcat by apache.

the class TestAttributeParser method evalAttr.

private String evalAttr(String expression, char quote) {
    ExpressionFactoryImpl exprFactory = new ExpressionFactoryImpl();
    ELContextImpl ctx = new ELContextImpl(exprFactory);
    ctx.setFunctionMapper(new TesterFunctions.FMapper());
    ValueExpression ve = exprFactory.createValueExpression(ctx, AttributeParser.getUnquoted(expression, quote, false, false, false, false), String.class);
    return (String) ve.getValue(ctx);
}
Also used : ExpressionFactoryImpl(org.apache.el.ExpressionFactoryImpl) TesterFunctions(org.apache.el.TesterFunctions) ValueExpression(jakarta.el.ValueExpression) ELContextImpl(org.apache.jasper.el.ELContextImpl)

Aggregations

ExpressionFactoryImpl (org.apache.el.ExpressionFactoryImpl)2 TesterFunctions (org.apache.el.TesterFunctions)2 ELContextImpl (org.apache.jasper.el.ELContextImpl)2 ValueExpression (jakarta.el.ValueExpression)1 ValueExpression (javax.el.ValueExpression)1