xianz666

 

 

 

1.new JSONObject().toJSONString(rootEntity)
JSONObject.toJSONString(specPrices)//specPrices实体类
 
2. JSONObject jsonObject = JSONObject.fromObject(emp);
3.String s= JSONArray.fromObject(user).toString();

json对象中的list集合取出转为实体类集合:

List<User> userList = JSONArray.parseArray(dept.getUser(), User.class);

json转实体类

PriceListInitResult res = JSONObject.parseObject(itemStr, PriceListInitResult.class);

 

分类:

技术点:

相关文章: