Package org.apache.el

Examples of org.apache.el.ExpressionFactoryImpl.createValueExpression()


                    return variableMapper;
                }
            };

            for (int j = 0; j < expressions.length; j++) {
                final ValueExpression ve = expressionFactory.createValueExpression(elContext, expressions[j], Object.class);
                final Object result = ve.getValue(elContext);
                if (i % 10000 == 0) {
                    System.out.println(result);
                }
            }
View Full Code Here


    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),
                String.class);
        return (String) ve.getValue(ctx);
    }
View Full Code Here

        // Don't try and evaluate expressions that depend on variables or functions
        if (expected != null) {
            try {
                ExpressionFactory factory = new ExpressionFactoryImpl();
                ELContext context = new ELContextImpl();
                ValueExpression ve = factory.createValueExpression(context, input, String.class);
                elResult = ve.getValue(context).toString();
                Assert.assertEquals(expected, elResult);
            } catch (ELException ele) {
                elException = ele;
            }
View Full Code Here

    private String evaluateExpression(String expression) {
        ELContextImpl ctx = new ELContextImpl();
        ctx.setFunctionMapper(new FMapper());
        ExpressionFactoryImpl exprFactory = new ExpressionFactoryImpl();
        ValueExpression ve = exprFactory.createValueExpression(ctx, expression,
                String.class);
        return (String) ve.getValue(ctx);
    }
   
    public static class FMapper extends FunctionMapper {
View Full Code Here

    private String evaluateExpression(String expression) {
        ELContextImpl ctx = new ELContextImpl();
        ctx.setFunctionMapper(new FMapper());
        ExpressionFactoryImpl exprFactory = new ExpressionFactoryImpl();
        ValueExpression ve = exprFactory.createValueExpression(ctx, expression,
                String.class);
        return (String) ve.getValue(ctx);
    }
   
    public static class FMapper extends FunctionMapper {
View Full Code Here

    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),
                String.class);
        return (String) ve.getValue(ctx);
    }
View Full Code Here

    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),
                String.class);
        return (String) ve.getValue(ctx);
    }
View Full Code Here

    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),
                String.class);
        return (String) ve.getValue(ctx);
    }
View Full Code Here

    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),
                String.class);
        return (String) ve.getValue(ctx);
    }
   
View Full Code Here

        final VariableMapper variableMapper = new MulticontextReadOnlyVariableMapper(testConstants, providedContext.getContext());
        final RuleEvaluator ruleEvaluator = new RuleEvaluator(expressionFactory, functionMapper, testDefinition.getConstants());
        final ELContext elContext = ruleEvaluator.createELContext(variableMapper);
        if(!isEmptyWhitespace(testRule)){
            try {
                final ValueExpression valueExpression = expressionFactory.createValueExpression(elContext, testRule, Boolean.class);
                if (providedContext.isEvaluable()) { /*
                                                       * must have a context to test against, even if it's "Collections.emptyMap()", how to
                                                       * tell if this method is used for ProctorBuilder or during load of the testMatrix.
                                                       * also used to check to make sure any classes included in the EL have a
                                                       * default constructor for evaluation (unless they are an enum)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.