String goodBeanStr = bean.getGood_list();//获得josn格式字符串
JSONArray jsonArr = JSONArray.fromObject(goodBeanStr);//转换成JSONArray 格式
List<AddProduct> goodBeanList = JSONArray.toList(jsonArr, AddProduct.class);//获得产品数组
JSONArray jsonArr = JSONArray.fromObject(goodBeanStr);//转换成JSONArray 格式
List<AddProduct> goodBeanList = JSONArray.toList(jsonArr, AddProduct.class);//获得产品数组
本文介绍了一种将JSON格式的字符串转换为Java对象列表的方法。首先从原始字符串中获取JSON格式的数据,然后使用JSONArray进行解析,并最终转换为AddProduct对象的列表。
1652

被折叠的 条评论
为什么被折叠?



