Package us.monoid.web.jp.javacc.JSONPathCompiler

Examples of us.monoid.web.jp.javacc.JSONPathCompiler.JSONPathExpr.eval()


    evaluator = parse("store.book");
    result = evaluator.eval(json);
    System.out.println(result);
    assertTrue(result instanceof JSONArray);
    evaluator = parse("store.book[category='fiction'].author");
    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("Evelyn Waugh", result);
   
    evaluator = parse("store.book[!category='reference'].author");
    result = evaluator.eval(json);
View Full Code Here


    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("Evelyn Waugh", result);
   
    evaluator = parse("store.book[!category='reference'].author");
    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("Evelyn Waugh", result);
   
    evaluator = parse("store.book[price>9].author");
    result = evaluator.eval(json);
View Full Code Here

    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("Evelyn Waugh", result);
   
    evaluator = parse("store.book[price>9].author");
    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("Evelyn Waugh", result);
   
    evaluator = parse("store.book[price>12.999].author");
    result = evaluator.eval(json);
View Full Code Here

    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("Evelyn Waugh", result);
   
    evaluator = parse("store.book[price>12.999].author");
    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("J. R. R. Tolkien", result);
   
    evaluator = parse("store.book[price>9 && price<12.999].author");
    result = evaluator.eval(json);
View Full Code Here

    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("J. R. R. Tolkien", result);
   
    evaluator = parse("store.book[price>9 && price<12.999].author");
    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("Evelyn Waugh", result);
   
    evaluator = parse("store.book[reviewed-by.name='JB'].author");
    result = evaluator.eval(json);
View Full Code Here

    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("Evelyn Waugh", result);
   
    evaluator = parse("store.book[reviewed-by.name='JB'].author");
    result = evaluator.eval(json);
    System.out.println(result);
    assertEquals("Nigel Rees", result);
   
   
   
View Full Code Here

  @Test
  public void testArray() throws ParseException, JSONException {
    System.out.println(this.getClass().getResource("array-test.json"));
    JSONObject json = read(this.getClass().getResource("array-test.json"));
    JSONPathExpr evaluator = parse("backdrops[image.width=1280]");
    Object result = evaluator.eval(json);
    System.out.println(result);
  }
 
}
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.