I’m using Java and I need to parse a Json string to a nested map structure or trie tree structure, The challenge is that I don’t know the detailed Json structure explicitly, which means the coming Json for example looks like:
{ "id":1, "name":"Frank", "Address":{ "city":"New York", "state":"NY"}, "lastactive":01-02-2017", "obj":{"type":"list","list":[1, 5, 6]} } { "id":4, "name":"Geerry", "Address":{ "city":"Seattle", "state":"WA"}, "lastactive":01-04-2017", "obj":{"type":"name","name":"myfile"}, "data":[ "onetype":[ {"id":2,"name":"John Doe"}, {"id":3,"name":"Don Joeh"} ] ] }
it shares some common structure while not all of the structure are the same, so when I declare a map, I can not explicitly tell the data type, is there a way for me to handle this?