I want to write a JSON parser that parses input JSON of depth n for college assignment.
As far as I have understood, I will have to convert this JSON into <String, Object>
map and then create classes out of it.
Is this correct? also How would I come to know exact datatypes of the values in JSON?
for ex my sample JSON sis.
{
“name”: “user”,
“address”: {
"city":"abc",
"zip":12345
}
}
Then I am supposed to create a class named say User that has to fields 1. name: String 2. Adderss : Object and Address class having city : string and zip :int with getters and setters.
Is this correct? How to dynamically create a class? How should I start ?