Package org.apache.commons.jexl

Examples of org.apache.commons.jexl.JexlContext


        Object actual = e.evaluate(jc);
        assertEquals(Boolean.FALSE, actual);
    }

    public void test_COMPLEX() throws Exception {
        JexlContext jc = JexlHelper.createContext();

        jc.getVars().put("A", Boolean.TRUE);
        jc.getVars().put("B", Boolean.FALSE);
        jc.getVars().put("C", Boolean.FALSE);

        Expression e = ExpressionFactory.createExpression("(A || B) && !C");
        Object actual = e.evaluate(jc);
        assertEquals(Boolean.TRUE, actual);
    }
View Full Code Here


        log.debug("Evaluating expression: {}", expression);
       
        Expression expr = ExpressionFactory.createExpression(expression);

        JexlContext ctx = JexlHelper.createContext();
        ctx.setVars(vars);

        Object result = expr.evaluate(ctx);
        log.debug("Result: {}", result);

        return result;
View Full Code Here

TOP

Related Classes of org.apache.commons.jexl.JexlContext

Copyright © 2018 www.massapicom. 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.