commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jones, MichaelD" <michaeld.jo...@novartis.com>
Subject [jexl]
Date Thu, 30 Aug 2012 16:22:30 GMT
I am curiose about the behavior of ExpressionImpl.getVariables(). Some cases not all of the
variables are reported. Is this by design?





 @Test
    public void testJexlEngine(){
        JexlEngine engine = new JexlEngine();

        engine.setSilent(false);
        engine.setLenient(false);
        engine.setDebug(true);

        String exp = "(A)";
        ExpressionImpl jexlExp = (ExpressionImpl)engine.createExpression(exp);
        log.debug("The jexlExpression: " + jexlExp);
        log.debug("The variables: " + jexlExp.getVariables());

        exp = "not(A)";
        jexlExp = (ExpressionImpl)engine.createExpression(exp);
        log.debug("The jexlExpression: " + jexlExp);
        log.debug("The features: " + jexlExp.getVariables());

        exp = "not((A))";
        jexlExp = (ExpressionImpl)engine.createExpression(exp);
        log.debug("The jexlExpression: " + jexlExp);
        log.debug("The features: " + jexlExp.getVariables());

    }





[junit] 10:51:20,868 DEBUG TestParser:85 - The jexlExpression: (A)

[junit] 10:51:20,873 DEBUG TestParser:86 - The variables: [[A]]

[junit] 10:51:20,874 DEBUG TestParser:90 - The jexlExpression: not(A)

[junit] 10:51:20,874 DEBUG TestParser:91 - The features: [[A]]

[junit] 10:51:20,875 DEBUG TestParser:95 - The jexlExpression: not((A))

[junit] 10:51:20,943 DEBUG TestParser:96 - The features: []







Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message