Examples of parseRaw()


Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

    // read it, set it, read it again
    Expression expr = parser.parseRaw("str");
    Object value = expr.getValue(ctx);
    assertEquals("wibble", value);
    expr = parser.parseRaw("str");
    expr.setValue(ctx, "wobble");
    expr = parser.parseRaw("str");
    value = expr.getValue(ctx);
    assertEquals("wobble", value);
    // or using assignment within the expression
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

    Expression expr = parser.parseRaw("str");
    Object value = expr.getValue(ctx);
    assertEquals("wibble", value);
    expr = parser.parseRaw("str");
    expr.setValue(ctx, "wobble");
    expr = parser.parseRaw("str");
    value = expr.getValue(ctx);
    assertEquals("wobble", value);
    // or using assignment within the expression
    expr = parser.parseRaw("str='wabble'");
    value = expr.getValue(ctx);
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

    expr.setValue(ctx, "wobble");
    expr = parser.parseRaw("str");
    value = expr.getValue(ctx);
    assertEquals("wobble", value);
    // or using assignment within the expression
    expr = parser.parseRaw("str='wabble'");
    value = expr.getValue(ctx);
    expr = parser.parseRaw("str");
    value = expr.getValue(ctx);
    assertEquals("wabble", value);
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

    value = expr.getValue(ctx);
    assertEquals("wobble", value);
    // or using assignment within the expression
    expr = parser.parseRaw("str='wabble'");
    value = expr.getValue(ctx);
    expr = parser.parseRaw("str");
    value = expr.getValue(ctx);
    assertEquals("wabble", value);

    // private property will be accessed through getter()
    expr = parser.parseRaw("property");
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

    expr = parser.parseRaw("str");
    value = expr.getValue(ctx);
    assertEquals("wabble", value);

    // private property will be accessed through getter()
    expr = parser.parseRaw("property");
    value = expr.getValue(ctx);
    assertEquals(42, value);

    // ... and set through setter
    expr = parser.parseRaw("property=4");
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

    expr = parser.parseRaw("property");
    value = expr.getValue(ctx);
    assertEquals(42, value);

    // ... and set through setter
    expr = parser.parseRaw("property=4");
    value = expr.getValue(ctx);
    expr = parser.parseRaw("property");
    value = expr.getValue(ctx);
    assertEquals(4,value);
  }
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

    assertEquals(42, value);

    // ... and set through setter
    expr = parser.parseRaw("property=4");
    value = expr.getValue(ctx);
    expr = parser.parseRaw("property");
    value = expr.getValue(ctx);
    assertEquals(4,value);
  }

  public static String repeat(String s) { return s+s; }
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

      SpelExpressionParser parser = new SpelExpressionParser();
      // Use the standard evaluation context
      StandardEvaluationContext ctx = new StandardEvaluationContext();
      ctx.registerFunction("repeat",ExpressionLanguageScenarioTests.class.getDeclaredMethod("repeat",String.class));

      Expression expr = parser.parseRaw("#repeat('hello')");
      Object value = expr.getValue(ctx);
      assertEquals("hellohello", value);

    } catch (EvaluationException ee) {
      ee.printStackTrace();
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

    SpelExpressionParser parser = new SpelExpressionParser();
    // Use the standard evaluation context
    StandardEvaluationContext ctx = new StandardEvaluationContext();

    ctx.addPropertyAccessor(new FruitColourAccessor());
    Expression expr = parser.parseRaw("orange");
    Object value = expr.getValue(ctx);
    assertEquals(Color.orange, value);

    try {
      expr.setValue(ctx, Color.blue);
View Full Code Here

Examples of org.springframework.expression.spel.standard.SpelExpressionParser.parseRaw()

    SpelExpressionParser parser = new SpelExpressionParser();
    // Use the standard evaluation context
    StandardEvaluationContext ctx = new StandardEvaluationContext();

    ctx.addPropertyAccessor(new VegetableColourAccessor());
    Expression expr = parser.parseRaw("pea");
    Object value = expr.getValue(ctx);
    assertEquals(Color.green, value);

    try {
      expr.setValue(ctx, Color.blue);
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.