Package org.springframework.expression.spel.support

Examples of org.springframework.expression.spel.support.StandardEvaluationContext.lookupVariable()


    expectFailNotIncrementable(parser, ctx, "#wibble++");
    expectFailNotDecrementable(parser, ctx, "--#wibble");
    e = parser.parseExpression("#wibble=#wibble+#wibble");
    String s = e.getValue(ctx,String.class);
    assertEquals("hello worldhello world",s);
    assertEquals("hello worldhello world",ctx.lookupVariable("wibble"));

    ctx.setVariable("wobble", 3);
    e = parser.parseExpression("#wobble++");
    assertEquals(3,((Integer)ctx.lookupVariable("wobble")).intValue());
    int r = e.getValue(ctx,Integer.TYPE);
View Full Code Here


    assertEquals("hello worldhello world",s);
    assertEquals("hello worldhello world",ctx.lookupVariable("wibble"));

    ctx.setVariable("wobble", 3);
    e = parser.parseExpression("#wobble++");
    assertEquals(3,((Integer)ctx.lookupVariable("wobble")).intValue());
    int r = e.getValue(ctx,Integer.TYPE);
    assertEquals(3,r);
    assertEquals(4,((Integer)ctx.lookupVariable("wobble")).intValue());

    e = parser.parseExpression("--#wobble");
View Full Code Here

    ctx.setVariable("wobble", 3);
    e = parser.parseExpression("#wobble++");
    assertEquals(3,((Integer)ctx.lookupVariable("wobble")).intValue());
    int r = e.getValue(ctx,Integer.TYPE);
    assertEquals(3,r);
    assertEquals(4,((Integer)ctx.lookupVariable("wobble")).intValue());

    e = parser.parseExpression("--#wobble");
    assertEquals(4,((Integer)ctx.lookupVariable("wobble")).intValue());
    r = e.getValue(ctx,Integer.TYPE);
    assertEquals(3,r);
View Full Code Here

    int r = e.getValue(ctx,Integer.TYPE);
    assertEquals(3,r);
    assertEquals(4,((Integer)ctx.lookupVariable("wobble")).intValue());

    e = parser.parseExpression("--#wobble");
    assertEquals(4,((Integer)ctx.lookupVariable("wobble")).intValue());
    r = e.getValue(ctx,Integer.TYPE);
    assertEquals(3,r);
    assertEquals(3,((Integer)ctx.lookupVariable("wobble")).intValue());

    e = parser.parseExpression("#wobble=34");
View Full Code Here

    e = parser.parseExpression("--#wobble");
    assertEquals(4,((Integer)ctx.lookupVariable("wobble")).intValue());
    r = e.getValue(ctx,Integer.TYPE);
    assertEquals(3,r);
    assertEquals(3,((Integer)ctx.lookupVariable("wobble")).intValue());

    e = parser.parseExpression("#wobble=34");
    assertEquals(3,((Integer)ctx.lookupVariable("wobble")).intValue());
    r = e.getValue(ctx,Integer.TYPE);
    assertEquals(34,r);
View Full Code Here

    r = e.getValue(ctx,Integer.TYPE);
    assertEquals(3,r);
    assertEquals(3,((Integer)ctx.lookupVariable("wobble")).intValue());

    e = parser.parseExpression("#wobble=34");
    assertEquals(3,((Integer)ctx.lookupVariable("wobble")).intValue());
    r = e.getValue(ctx,Integer.TYPE);
    assertEquals(34,r);
    assertEquals(34,((Integer)ctx.lookupVariable("wobble")).intValue());

    // Projection
View Full Code Here

    e = parser.parseExpression("#wobble=34");
    assertEquals(3,((Integer)ctx.lookupVariable("wobble")).intValue());
    r = e.getValue(ctx,Integer.TYPE);
    assertEquals(34,r);
    assertEquals(34,((Integer)ctx.lookupVariable("wobble")).intValue());

    // Projection
    expectFailNotIncrementable(parser, ctx, "({1,2,3}.![#isEven(#this)])++"); // projection would be {false,true,false}
    expectFailNotDecrementable(parser, ctx, "--({1,2,3}.![#isEven(#this)])"); // projection would be {false,true,false}
    expectFailNotAssignable(parser, ctx, "({1,2,3}.![#isEven(#this)])=({1,2,3}.![#isEven(#this)])");
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.