We have a relatively big json document but just need to the special fields of it. So, I defined the needed properties in my model and can serialize/deserialize, well. Recently we are forced to hand over the json document as we received, but since there are so much fields and these fields vary frequently, I'm looking for a method to do this without defining extra fields in the model. I couldn't do it by using an extra Map<String, Object>
in the model classes but I guess there should be an solution for it.
Let's suppose my model is like this:
public class Model {
public A a;
}
public class A {
public int i;
}
and the json is like this:
{
"a": {
"i": "1",
"j": {
"q": 2.11,
"e": "94300000",
"r": "book",
"t": null
},
"b": 1
},
"ff": [
{
"gg": "ttttttttt",
"dd": "oooooooo",
"jj": null,
"kk": [
"pppppppp"
]
},
{
"mm": null
}
]
}
How can I do it?