I have a problem trying to parse a json file to JSON object
My JSON File is under the form :
{ "objectJSON": [
{
"attribute":"value",
"attribute":"value",
"attribute":"value",
"attributes" :{
"att1": "val1",
"att2":"val2",
"att3":"val3",
// more atts and vals may figure here !
}
},
{
"attribute":"value",
"attribute":"value",
"attribute":"value",
"attributes" :{
"att1": "val1",
"att2":"val2",
"att3":"val3",
// more atts and vals may figure here !
}
}
]
}
my problem is that the object "attributes" has an unknown number of arguments so I can not create a class for it , I thought about using a
map<String,String> attributes;
but I don't know how to parse it from the file especially that I want to keep my class "ObjectJSON" witch represents the root of my file.
I'm using gson of google
thanks in advance .