I want to parse this JSON file in JAVA using GSON :
{
"descriptor" : {
"app1" : {
"name" : "mehdi",
"age" : 21,
"messages": ["msg 1","msg 2","msg 3"]
},
"app2" : {
"name" : "mkyong",
"age" : 29,
"messages": ["msg 11","msg 22","msg 33"]
},
"app3" : {
"name" : "amine",
"age" : 23,
"messages": ["msg 111","msg 222","msg 333"]
}
}
}
but I don't know how to acceed to the root element which is : descriptor, after that the app3 element and finally the name element.
I followed this tutorial http://www.mkyong.com/java/gson-streaming-to-read-and-write-json/, but it doesn't show the case of having a root and childs elements.