im trying to read the following json in java.
{
"guiCarport": {
"width": 500,
"depth": 500,
"height": 230
},
"guiRoof": {
"gableRoof": false,
"overhang": {
"sides": 20,
"front": 20,
"back": 20
}
},
"guiShed": {
"shed": false,
"depth": 300,
"doorPlacement": 0,
"side": "Foran",
"rotateDoor": false
}
}
so far my java code looks like this, in a java servlet:
String json = (String) request.getParameter("json");
Gson gson = new Gson();
JsonObject obj = gson.fromJson(json, JsonObject.class);
JsonElement base = obj.get("guiCarport");
JsonElement roof = obj.get("guiRoof");
JsonElement shed = obj.get("guiShed");
What is the easiest way for me to read the values of the objects and assign them to variables? I Have custom classes created for the different object, but i need a way to get the values first. Thanks!