@Test public void testNested() throws Exception { Condition condition = new Condition(); condition.setExpression(new BinaryExpression(Operator.LESS_THAN, new ArrayFieldExpression( new MapFieldExpression(getVariable("map"), "foo"), 100), getVariable("b"))); GroovyExpression expr = new GroovyExpression(condition); Assert.assertEquals("map['foo'][100] < b", expr.asString()); }
@Override public String asString() { if (expression == null) { GroovyExpressionTranslator expressionTranslator = new GroovyExpressionTranslator(); condition.getExpression().accept(expressionTranslator); expression = expressionTranslator.getTranslatedExpression(); } return expression; }
GroovyExpression extends ExpressionRuntime { @Override public String asString() { if (expression == null) { GroovyExpressionTranslator expressionTranslator = new GroovyExpressionTranslator(); condition.getExpression().accept(expressionTranslator); expression = expressionTranslator.getTranslatedExpression(); } return expression; } }
GroovyExpression extends ExpressionRuntime { @Override public String asString() { if (expression == null) { GroovyExpressionTranslator expressionTranslator = new GroovyExpressionTranslator(); condition.getExpression().accept(expressionTranslator); expression = expressionTranslator.getTranslatedExpression(); } return expression; } GroovyExpression(Condition condition); }
GroovyExpression extends ExpressionRuntime { @Override public String asString() { if (expression == null) { GroovyExpressionTranslator expressionTranslator = new GroovyExpressionTranslator(); condition.getExpression().accept(expressionTranslator); expression = expressionTranslator.getTranslatedExpression(); } return expression; } GroovyExpression(Condition condition); @Override String asString(); }
GroovyExpression extends ExpressionRuntime { @Override public String asString() { if (expression == null) { GroovyExpressionTranslator expressionTranslator = new GroovyExpressionTranslator(); condition.getExpression().accept(expressionTranslator); expression = expressionTranslator.getTranslatedExpression(); } return expression; } GroovyExpression(Condition condition); @Override String asString();  }