Say I have a compound JSON object like so:
{
"Person": {
"name":"test",
"age": 20
},
"Animal": {
"name":"Max"
}
}
This JSON representation has two embedded types Person and Animal, yet, I want to parse and extract a representation of each individual type (resulting in two Strings?).
Is this possible? I was thinking of using Jackson but can’t find a suitable example.
Any JSON parser can do this.
If you’re not looking to map to a POJO and want to use Jackson, you’re probably looking for the Tree Model: http://wiki.fasterxml.com/JacksonTreeModel