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);

 

分类:

技术点:

相关文章:

  • 2022-02-26
  • 2021-07-01
  • 2022-12-23
  • 2021-04-12
  • 2022-12-23
  • 2021-09-19
  • 2021-11-28
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2021-12-31
  • 2021-04-11
  • 2021-07-21
  • 2021-11-28
  • 2021-11-28
相关资源
相似解决方案