voglio analizzare questo file di JSON in JAVA utilizzando GSON:file di Parse JSON utilizzando 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"]
}
}
}
ma io non so come acceed per l'elemento principale che è: descrittore, successivamente l'elemento app3 e infine l'elemento nome.
Ho seguito questo tutorial http://www.mkyong.com/java/gson-streaming-to-read-and-write-json/, ma non mostra il caso di avere elementi di root e childs.
Ecco un esempio http://thegeekyland.blogspot.com/2015/11/serializing-and-deserializing-json-from.html – Arlind