把对象或者数组转化成json字符串:
- publicstaticStringcreateJsonString(Objectvalue)
- {
- StringalibabaJson=JSON.toJSONString(value);
- returnalibabaJson;
- }
把Json字符串转化成对象或者数组:
原文链接:https://www.f2er.com/json/290544.html
- List<Person>persons2=JSON.parseArray(jsonString,Person.class);
- Personperson=JSON.parSEObject(jsonString,Person.class);