Home > Back-end >  Fastjson complex parsing json string
Fastjson complex parsing json string

Time:01-01

For complex types of json string, such as "{" brand \ ": {" name \ ": " asus \ ", \ "letter " : \ \ "H"}, \ "cids " : [1, 2]} "this how to parse

CodePudding user response:

1, if every time a json structure will come out more or less field, then directly with jsonobject + jsonarray layers and layers of parsing
2, if every time a json structure are all the same, you don't want to write a pojo, you will receive a map with
3, if every time a json structure are all the same, you are willing to write a pojo, so you can write according to the structure order pojo
4, if you are willing to create a pojo, but don't want to write, so the following url to remember good, can generate pojo at http://www.bejson.com/

CodePudding user response:

Create a corresponding Object, field and type and corresponding can parse the json string,
  • Related