Package org.springframework.binding.expression

Examples of org.springframework.binding.expression.ExpressionVariable


  public void testTemplateNestedVariables() {
    String expressionString = "#{value}#{max}";
    Expression exp = parser.parseExpression(
        expressionString,
        new FluentParserContext().template().variable(
            new ExpressionVariable("max", "#{maximum}#{var}", new FluentParserContext().template()
                .variable(new ExpressionVariable("var", "'bar'")))));
    TestBean target = new TestBean();
    assertEquals("foo2bar", exp.getValue(target));
  }
View Full Code Here


  }

  public void testParseTemplateExpressionWithVariables() {
    String expressionString = "#{value}#{#max}";
    Expression exp = parser.parseExpression(expressionString,
        new FluentParserContext().template().variable(new ExpressionVariable("max", "maximum")));
    TestBean target = new TestBean();
    assertEquals("foo2", exp.getValue(target)); // TODO:
  }
View Full Code Here

    parser.parseExpression("a${b,#{1:2},e}f${g,#{3:4},j}k", new FluentParserContext().template());
  }

  public void testVariables() {
    Expression exp = parser.parseExpression("#var",
        new FluentParserContext().variable(new ExpressionVariable("var", "flag")));
    assertFalse((Boolean) exp.getValue(bean));
  }
View Full Code Here

        new FluentParserContext().variable(new ExpressionVariable("var", "flag")));
    assertFalse((Boolean) exp.getValue(bean));
  }

  public void testVariablesWithCoersion() {
    Expression exp = parser.parseExpression("#var", new FluentParserContext().variable(new ExpressionVariable(
        "var", "number", new FluentParserContext().expectResult(Long.class))));
    assertEquals(new Long(0), exp.getValue(bean));
  }
View Full Code Here

        "var", "number", new FluentParserContext().expectResult(Long.class))));
    assertEquals(new Long(0), exp.getValue(bean));
  }

  public void testNestedVariablesWithTemplates() {
    Expression exp = parser.parseExpression("#var", new FluentParserContext().variable(new ExpressionVariable(
        "var", "${flag}${#var}", new FluentParserContext().template().variable(
            new ExpressionVariable("var", "number")))));
    assertEquals("false0", exp.getValue(bean));
  }
View Full Code Here

TOP

Related Classes of org.springframework.binding.expression.ExpressionVariable

Copyright © 2018 www.massapicom. 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.