Package ej.rest.web
Class JSONPathQuery
- java.lang.Object
-
- ej.rest.web.PathQuery<JSONResource,Object>
-
- ej.rest.web.JSONPathQuery
-
public class JSONPathQuery extends PathQuery<JSONResource,Object>
Create a path query for a JSON object. Usualy this is done by calling Resty.path(...) A JSONPathQuery is similar to JsonPath or XPath in that you can create access paths into an JSON object. It uses dot '.' as a path separator and [] to access arrays. The array index is either a number or an expression to evaluate for each object in the array. The first matching object is returned. I.e.store.book[price>7 && price<12.999].authorIn the example above the JSON object with a prive value between 7 and 12.999 is selected and the author returned. Boolean expressions are supported with && (and), || (or), ! (not). Values can be compared with =,<,>.
-
-
Constructor Summary
Constructors Constructor Description JSONPathQuery(String anExpression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JSONPathCompilergetCompiler()
-
-
-
Constructor Detail
-
JSONPathQuery
public JSONPathQuery(String anExpression)
-
-
Method Detail
-
getCompiler
protected JSONPathCompiler getCompiler() throws ParseException
- Throws:
ParseException
-
-