public class JsonData extends Object implements Serializable
JsonNode
object that
allows for nested object keys i.e. user/name will return the name property on
the user object.
There is no 'xpath' for JSON yet (though I expect Jackson to do implement this at some point).
This class provides a simple way to navigate a Json data structure. To select a child entry use -
person/name
to access array data, use square braces with an index value i.e.
person/addresses[0]/postcode
or
[0]/arrayElement
Also, multi-dimensional arrays can be accessed using:
filters[1]/init[1][0]
if a Json property name contains a '/' the name needs to be quoted with single quotes i.e.
results/'http://foo.com'/value
Constructor and Description |
---|
JsonData(InputStream node) |
JsonData(org.codehaus.jackson.JsonNode node) |
JsonData(Reader node) |
JsonData(String node) |
JsonData(URL node) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
org.codehaus.jackson.JsonNode |
get(int index) |
org.codehaus.jackson.JsonNode |
get(String expression) |
String |
getAsString(String expression) |
int |
hashCode() |
boolean |
hasNode(String key) |
boolean |
isArray() |
protected List<String> |
parseTokens(String expresion) |
org.codehaus.jackson.JsonNode[] |
toArray() |
String |
toString() |
public JsonData(org.codehaus.jackson.JsonNode node)
public JsonData(URL node) throws IOException
IOException
public JsonData(InputStream node) throws IOException
IOException
public JsonData(Reader node) throws IOException
IOException
public JsonData(String node) throws IOException
IOException
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.