Examples of parseRaw()


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

  @Test
  public void projectionTypeDescriptors_1() throws Exception {
    StandardEvaluationContext ctx = new StandardEvaluationContext(new C());
    SpelExpressionParser parser = new SpelExpressionParser();
    String el1 = "ls.![#this.equals('abc')]";
    SpelExpression exp = parser.parseRaw(el1);
    List<?> value = (List<?>) exp.getValue(ctx);
    // value is list containing [true,false]
    assertEquals(Boolean.class, value.get(0).getClass());
    TypeDescriptor evaluated = exp.getValueTypeDescriptor(ctx);
    assertEquals(null, evaluated.getElementTypeDescriptor());
View Full Code Here

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

  @Test
  public void projectionTypeDescriptors_2() throws Exception {
    StandardEvaluationContext ctx = new StandardEvaluationContext(new C());
    SpelExpressionParser parser = new SpelExpressionParser();
    String el1 = "as.![#this.equals('abc')]";
    SpelExpression exp = parser.parseRaw(el1);
    Object[] value = (Object[]) exp.getValue(ctx);
    // value is array containing [true,false]
    assertEquals(Boolean.class, value[0].getClass());
    TypeDescriptor evaluated = exp.getValueTypeDescriptor(ctx);
    assertEquals(Boolean.class, evaluated.getElementTypeDescriptor().getType());
View Full Code Here

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

  @Test
  public void projectionTypeDescriptors_3() throws Exception {
    StandardEvaluationContext ctx = new StandardEvaluationContext(new C());
    SpelExpressionParser parser = new SpelExpressionParser();
    String el1 = "ms.![key.equals('abc')]";
    SpelExpression exp = parser.parseRaw(el1);
    List<?> value = (List<?>) exp.getValue(ctx);
    // value is list containing [true,false]
    assertEquals(Boolean.class, value.get(0).getClass());
    TypeDescriptor evaluated = exp.getValueTypeDescriptor(ctx);
    assertEquals(null, evaluated.getElementTypeDescriptor());
View Full Code Here

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

    StandardEvaluationContext ctx = new StandardEvaluationContext(list);
    SpelExpressionParser parser = new SpelExpressionParser();

    String el1 = "#root.?[a < 'hhh']";
    SpelExpression exp = parser.parseRaw(el1);
    Object value = exp.getValue(ctx);
    assertEquals("[D(aaa), D(bbb), D(null), D(ccc), D(null)]", value.toString());

    String el2 = "#root.?[a > 'hhh']";
    SpelExpression exp2 = parser.parseRaw(el2);
View Full Code Here

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

    SpelExpression exp = parser.parseRaw(el1);
    Object value = exp.getValue(ctx);
    assertEquals("[D(aaa), D(bbb), D(null), D(ccc), D(null)]", value.toString());

    String el2 = "#root.?[a > 'hhh']";
    SpelExpression exp2 = parser.parseRaw(el2);
    Object value2 = exp2.getValue(ctx);
    assertEquals("[D(zzz)]", value2.toString());

    // trim out the nulls first
    String el3 = "#root.?[a!=null].?[a < 'hhh']";
View Full Code Here

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

    Object value2 = exp2.getValue(ctx);
    assertEquals("[D(zzz)]", value2.toString());

    // trim out the nulls first
    String el3 = "#root.?[a!=null].?[a < 'hhh']";
    SpelExpression exp3 = parser.parseRaw(el3);
    Object value3 = exp3.getValue(ctx);
    assertEquals("[D(aaa), D(bbb), D(ccc)]", value3.toString());
  }

  /**
 
View Full Code Here

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

    }

    StandardEvaluationContext ctx = new StandardEvaluationContext(new Reserver());
    SpelExpressionParser parser = new SpelExpressionParser();
    String ex = "getReserver().NE";
    SpelExpression exp = parser.parseRaw(ex);
    String value = (String) exp.getValue(ctx);
    assertEquals("abc", value);

    ex = "getReserver().ne";
    exp = parser.parseRaw(ex);
View Full Code Here

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

    SpelExpression exp = parser.parseRaw(ex);
    String value = (String) exp.getValue(ctx);
    assertEquals("abc", value);

    ex = "getReserver().ne";
    exp = parser.parseRaw(ex);
    value = (String) exp.getValue(ctx);
    assertEquals("def", value);

    ex = "getReserver().m[NE]";
    exp = parser.parseRaw(ex);
View Full Code Here

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

    exp = parser.parseRaw(ex);
    value = (String) exp.getValue(ctx);
    assertEquals("def", value);

    ex = "getReserver().m[NE]";
    exp = parser.parseRaw(ex);
    value = (String) exp.getValue(ctx);
    assertEquals("xyz", value);

    ex = "getReserver().DIV";
    exp = parser.parseRaw(ex);
View Full Code Here

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

    exp = parser.parseRaw(ex);
    value = (String) exp.getValue(ctx);
    assertEquals("xyz", value);

    ex = "getReserver().DIV";
    exp = parser.parseRaw(ex);
    assertEquals(1, exp.getValue(ctx));

    ex = "getReserver().div";
    exp = parser.parseRaw(ex);
    assertEquals(3, exp.getValue(ctx));
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.