{
"CId" : "Integer,"
"AId" : "String",
"StartTime", "Long",
"Config" : {
"PicType" : "Integer,"
"PicUrl" : "String",
"ShowField" : [
"Integer,"
"Integer"
],
"NeedRegister" : false
},
"Does" : "Boolean"
}
According to the field type to generate corresponding Java objects
Public class Test {
Private Integer cId.
Private String aId;
Private Long startTime.
Private Config Config.
Private Boolean does;
Getter/setter () ()
}
Public class Config {
Private picType picType;
Private String picUrl;
Private List
Private Boolean needRegister;
Getter/setter () ()
}
Please tell the great god, thanked here
CodePudding user response:
You are going to use ready-made libraries or intend to parse the json?If use merchant class library to download a few json packages, such as Jackson, org. Json packages, these packages have turn json object method,
If you want to write their own, with regular and reflection can handle, (to build their own wheels. There is no need)
CodePudding user response:
Import the jar package, com. Alibaba. Fastjson. JSONObjectTest obj=JSONObject. ParseObject (json, the Test class);
CodePudding user response:
You want to ask what? You write this is right