Package com.firefly.template.parser

Examples of com.firefly.template.parser.StatementExpression


    Assert.assertThat(se.parse("${i} + ${j} + ${k}"), is("objNav.getValue(model ,\"i\") + objNav.getValue(model ,\"j\") + objNav.getValue(model ,\"k\")"));
  }
 
  @Test
  public void testELParseError2() {
    StatementExpression se = new StatementExpression();
    Assert.assertThat(se.parse("${i} + ${j} + 2"),is(se.parse("${i}-- + ${j} + 2")));
  }
View Full Code Here


    Assert.assertThat(se.parse("${i} + ${j} + 2"),is(se.parse("${i}-- + ${j} + 2")));
  }
 
  @Test(expected = ExpressionError.class)
  public void testELParseError3() {
    StatementExpression se = new StatementExpression();
    se.parse("${i} >= ${j} < ${k}");
  }
View Full Code Here

    StatementExpression se = new StatementExpression();
    se.parse("${i} >= ${j} < ${k}");
  }
 
  public static void main(String[] args) {
    StatementExpression se = new StatementExpression();
    System.out.println(se.parse("${i} + ${j} + ${k}"));
    System.out.println(se.parse("${i} + ${j} + 2"));
    System.out.println(se.parse("${i}-- + ${j} + 2"));
    System.out.println(se.parse("${i} >= ${j} < ${k}"));
  }
View Full Code Here

//    System.out.println(preprocessing("3 + 4 + -(-(2 - 1) + 1)"));
//    System.out.println(getReversePolishNotation("3 + 4 + -(-(2 - 1) + 1)"));
//    System.out.println(preprocessing("${apple.price} > 7f && -(${apple.price} + 2) * 0.4 + 4 <= 3"));
    System.out.println(getReversePolishNotation("!(${apple.price} > 7f && -(${apple.price} + 2) * 0.4 + 4 <= 3)"));
   
    StatementExpression se = new StatementExpression();
    System.out.println(se.parse("-(3 + 4) > 8 && !(${i} > 0)"));
    System.out.println(se.parse("(0-(0 - ${i})) * 4"));
    System.out.println(se.parse("-(3 + 4) +-( -(2 - 1) + 1)"));
    System.out.println(se.parse("!(${apple.price} > 7f && -(${apple.price} + 2) * 0.4 + 4 <= 3)"));
    System.out.println(se.parse("${i} != null && ${i.size} > 0"));
  }
View Full Code Here

    System.out.println(se.parse("${i} != null && ${i.size} > 0"));
  }
 
  public static void main5(String[] args) {
    System.out.println(((Object)"Bob").equals("Bob"));
    StatementExpression se = new StatementExpression();
    System.out.println(se.parse("'pt1 !'!= ${i}"));
    System.out.println(se.parse("${i}!= 'pt1 !'"));
    System.out.println(se.parse("'pt1 !' != 'pt1 !'"));
//    String str = null;
//    System.out.println("".equals(null));
    List<Fragment> list = getReversePolishNotation("${i} != null && ${i} != ${k}");
    System.out.println(list.toString());
    for(Fragment f : list) {
      System.out.print(f.type + ", ");
    }
    System.out.println();
    System.out.println(se.parse("${i} != null && null == ${j} && ${i} != ${k}"));
   
  }
View Full Code Here

    for(Fragment f : list) {
      System.out.print(f.type + ", ");
    }
    System.out.println();
   
    StatementExpression se = new StatementExpression();
   
    System.out.println(se.parse("!(${apple.price} > 7f && ${apple.price} <= 3)"));
    System.out.println(se.parse("${apple.price} > 7f && ${apple.price} <= 3"));
    System.out.println(se.parse("!${i} || !${j} && ${k}"));
    System.out.println(se.parse("5 > 3 && 5 > 2"));
    System.out.println(se.parse("${i} || 5 < 3 && 5 > 2"));
  }
View Full Code Here

    System.out.println(Float.parseFloat("3.5") + Long.parseLong("4"));
   
    System.out.println(getReversePolishNotation("3 + 3 * 5 / 2"));
    System.out.println(getReversePolishNotation("3 + 3 * 5 / 2"));
    System.out.println("================================================");
    StatementExpression se = new StatementExpression();
   
    System.out.println(se.parse("3L + 3L * 5L / 2L"));
    System.out.println(se.parse("3 + 3 * 5 / 2"));
    System.out.println(se.parse("3.0 + 3 * 5.0 / 2.0"));
    System.out.println(se.parse("3 + 3f * 5 / 2f"));
    System.out.println(se.parse("\"hello \" + \"firefly \""));
    System.out.println(se.parse("'hello ' + 'firefly ' + '!'"));
    System.out.println(se.parse("'hello ' + 'firefly ' + ${i} + '!'"));
//    System.out.println(se.parse("${i} + ${j} + ${k}"));
   
    System.out.println(se.parse("${i} + 3 + 5 + 2 / 1.0"));
    System.out.println(se.parse("(3f + ${j}) / 2 + ${i} + 1.0"));
    System.out.println(se.parse("1L +" + Integer.MAX_VALUE));
    System.out.println(1 + Integer.MAX_VALUE);
    System.out.println(se.parse("(3f + ${apple.price}) / 2 + ${i} + 1.0"));
    System.out.println(se.parse("(3f + ${apple.price}) / 2 + ${i} + 1.0 >= 2"));
    System.out.println(se.parse("!${i} || !${j} && ${k}"));
    System.out.println(se.parse("1 | 2 & ${i}"));
    System.out.println(se.parse("${i} & ${j}"));
//    System.out.println(se.parse("${apple.price} + 1f >= 5 && ${apple.price} + 1f < 10"));
//    System.out.println(se.parse("! ${user1.pass} == !true && ${user2.pass} == true "));
   
    System.out.println(se.parse("!${user.pass}"));
//    System.out.println(se.parse("(3f + ${j} --) / 2 + ${i}++ + 1.0"));
   
  }
View Full Code Here

TOP

Related Classes of com.firefly.template.parser.StatementExpression

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.