{"category_attribute_search_response":{"code":"0","total":14,"attributes":[{"aid":3201,"name":"品牌","cid":"1351"},{"aid":7716,"name":"类型","cid":"1351"},{"aid":8668,"name":"价格","cid":"1351"},{"aid":8664,"name":"款式","cid":"1351"},{"aid":8665,"name":"领形","cid":"1351"},{"aid":8667,"name":"材质","cid":"1351"},{"aid":10649,"name":"尺码","cid":"1351"},{"aid":14225,"name":"布种","cid":"1351"},{"aid":14224,"name":"板型","cid":"1351"},{"aid":14227,"name":"工艺","cid":"1351"},{"aid":14226,"name":"风格","cid":"1351"},{"aid":14223,"name":"厚薄","cid":"1351"},{"aid":1000000041,"name":"尺寸","cid":"1351"},{"aid":1000000027,"name":"颜色","cid":"1351"}]}} 这是json格式的数据,我想借助jar包转换成list或者javaBean实体,应该怎么弄? 知道的代码发一下,今天试验了网上的好几个方法,都不成功。大家帮下忙了。
那你可以获得这个category_attribute_search_response这个属性下的值拿去toBean啊 Java code
String json=你的json字符串;
JSONObject jsonObject=JSONObject.fromObject(json);
json=jsonObject.getString("category_attribute_search_response");
你的类型 object=(你的类型)JSONObject.toBean(json,你的class);
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。