java - jackson json to Object parsing -
i have task parse json java class.
json fragment trying parse , have problems tree structure.
the key point here parametervalue
may string, or array of parameter name/value pairs;
i use jackson mapper
response response = mapper.readvalue(jsonobjstring, response.class);
the problem here not know how can describe response class here, auto parsed jackson. if possible.
json:
[{ "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "apnrecord", "parametervalue" : [{ "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "name", "parametervalue" : "value" }] }]
you can try online json java pojo mapper, produces required result , comes in handy me many times.
http://pojo.sodhanalibrary.com/
try , if face more difficulties provide complete json receive, can work out thing else.
Comments
Post a Comment