注意: string类型字段为空时,设为“ ”,Integer类型字段为空时,要设为null,否则解析会出错
1.解析单个对象
String testStr = "{\"name\":\"Zhangsan\",\"age\":null,\"height\":180,\"address\":\" \"}; TestObject test = JSON.parSEObject(testStr,TestObject.class);
2.解析成对象List
List<TestObject> testList = JSON.parseArray(testStrList,TestObject.class);原文链接:https://www.f2er.com/json/290128.html