Examples of parseRaw()


Examples of com.iCo6.util.Template.parseRaw()

        Template template = iConomy.Template;
        template.set(Template.Node.PLAYER_BALANCE);
        template.add("name", name);
        template.add("balance", getHoldings().getBalance());

        return tag + template.parseRaw();
    }
}
View Full Code Here

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

  @Test
  public void failsWhenSettingContextForExpression_SPR12326() {
      SpelExpressionParser parser = new SpelExpressionParser(new SpelParserConfiguration(SpelCompilerMode.IMMEDIATE, this
              .getClass().getClassLoader()));
      Person3 person = new Person3("foo", 1);
      SpelExpression expression = parser.parseRaw("#it?.age?.equals([0])");
      StandardEvaluationContext context = new StandardEvaluationContext(new Object[] { 1 });
      context.setVariable("it", person);
      expression.setEvaluationContext(context);
      assertTrue(expression.getValue(Boolean.class));
      assertTrue(expression.getValue(Boolean.class));      
View Full Code Here

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

    // Variant of above more like what was in the bug report:
    SpelExpressionParser parser = new SpelExpressionParser(
        new SpelParserConfiguration(SpelCompilerMode.IMMEDIATE,
            this.getClass().getClassLoader()));

    SpelExpression ex = parser.parseRaw("#it?.age.equals([0])");
    context = new StandardEvaluationContext(new Object[] { person.getAge() });
    context.setVariable("it", person);
    assertTrue(ex.getValue(context, Boolean.class));
    assertTrue(ex.getValue(context, Boolean.class));
   
View Full Code Here

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

    context.setVariable("it", person);
    assertTrue(ex.getValue(context, Boolean.class));
    assertTrue(ex.getValue(context, Boolean.class));
   
    PersonInOtherPackage person2 = new PersonInOtherPackage(1);
    ex = parser.parseRaw("#it?.age.equals([0])");
    context =
        new StandardEvaluationContext(new Object[] { person2.getAge() });
    context.setVariable("it", person2);
    assertTrue(ex.getValue(context, Boolean.class));
    assertTrue(ex.getValue(context, Boolean.class));
View Full Code Here

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

        new StandardEvaluationContext(new Object[] { person2.getAge() });
    context.setVariable("it", person2);
    assertTrue(ex.getValue(context, Boolean.class));
    assertTrue(ex.getValue(context, Boolean.class));
   
    ex = parser.parseRaw("#it?.age.equals([0])");
    context =
        new StandardEvaluationContext(new Object[] { person2.getAge() });
    context.setVariable("it", person2);
    assertTrue((Boolean)ex.getValue(context));
    assertTrue((Boolean)ex.getValue(context));
View Full Code Here

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

  public void testScenario_UsingStandardInfrastructure() {
    try {
      // Create a parser
      SpelExpressionParser parser = new SpelExpressionParser();
      // Parse an expression
      Expression expr = parser.parseRaw("new String('hello world')");
      // Evaluate it using a 'standard' context
      Object value = expr.getValue();
      // They are reusable
      value = expr.getValue();
View Full Code Here

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

    ctx.setVariable("favouriteColour","blue");
    List<Integer> primes = new ArrayList<Integer>();
    primes.addAll(Arrays.asList(2,3,5,7,11,13,17));
    ctx.setVariable("primes",primes);

    Expression expr = parser.parseRaw("#favouriteColour");
    Object value = expr.getValue(ctx);
    assertEquals("blue", value);

    expr = parser.parseRaw("#primes.get(1)");
    value = expr.getValue(ctx);
View Full Code Here

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

    Expression expr = parser.parseRaw("#favouriteColour");
    Object value = expr.getValue(ctx);
    assertEquals("blue", value);

    expr = parser.parseRaw("#primes.get(1)");
    value = expr.getValue(ctx);
    assertEquals(3, value);

    // all prime numbers > 10 from the list (using selection ?{...})
    expr = parser.parseRaw("#primes.?[#this>10]");
View Full Code Here

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

    expr = parser.parseRaw("#primes.get(1)");
    value = expr.getValue(ctx);
    assertEquals(3, value);

    // all prime numbers > 10 from the list (using selection ?{...})
    expr = parser.parseRaw("#primes.?[#this>10]");
    value = expr.getValue(ctx);
    assertEquals("[11, 13, 17]", value.toString());
  }

View Full Code Here

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

    tc.setProperty(42);
    tc.str = "wibble";
    ctx.setRootObject(tc);

    // 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");
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.