I've checked almost all posts in SO, but i didn't get the solution
Question: I've the JSON like below
{
"address": {
"state": "World",
"address": "infinite space, 000",
"city": "Android city",
"address2": {
"state": "World2",
"address": "infinite space2, 002",
"city": "Android city2",
"address3": {
"state": "World3",
"address": "infinite space3, 003",
"city": "Android city3"
}
}
},
"valid": {
"state": "World",
"address": "infinite space, 000",
"city": "Android city",
"valid2": {
"state": "World2",
"address": "infinite space2, 002",
"city": "Android city2",
"valid3": {
"state": "World3",
"address": "infinite space3, 003",
"city": "Android city3"
}
}
}
}
In this, every object name was unique and in future i may have many nested JSON objects also.
My requirement is: I want to parse every nested JSON object dynamically.
For example: If i pass any object name. My method have to return every data (key and value) of that object or Suppurate every nested object from the JSON and maintain them supperatly