Java Code Examples for org.apache.el.ExpressionFactoryImpl#createValueExpression()

The following examples show how to use org.apache.el.ExpressionFactoryImpl#createValueExpression() . 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: TestAttributeParser.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
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);
    }
 
Example 2
Source File: TestAttributeParser.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
private String evalAttr(String expression, char quote) {

        ELContextImpl ctx = new ELContextImpl();
        ctx.setFunctionMapper(new 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);
    }
 
Example 3
Source File: TestAttributeParser.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
private String evalAttr(String expression, char quote) {

        ELContextImpl ctx = new ELContextImpl();
        ctx.setFunctionMapper(new 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);
    }