I'm writing a JSON-style query engine in Java, and it would benefit from the ability to query a JSON document by the DOM path (like you can do in Javascript). I've checked out GSON and Jackson, but neither seem to support this.
Anyone know of any alternatives, or other suggestions rather than rolling my own?
e.g.
//Example JSON document
String json = "{ somewhere : {deep : { inside : 123 } }, anarray : [{val=1}] }";
JsonElement root = JsonParser.parse(json);
//What I'd like:
JsonElement node = root.getByDOM("somewhere.deep"); // {inside : 123}
JsonElement node2 = root.getByDOM("somewhere.deep.inside"); // 123
JsonElement node3 = root.getByDOM("anarray[0].val"); // 1
//etc