解析json数组
2017-04-18 17:25
120 查看
1 String json = "[{code:0,message:\'success or error\',id:\"0001\",name:\"pic.jpg\"},{code:0,message:\'success or error\',id:\"0001\",name:\"pic.jpg\"},{code:0,message:\'success or error\',id:\"0001\",name:\"pic.jpg\"}]"; 2 net.sf.json.JSONArray jsonArr = net.sf.json.JSONArray.fromObject(jsonData); 3 for(int i=0;i<jsonArr.size();i++){ 4 net.sf.json.JSONObject job = jsonArr.getJSONObject(i); // 遍历 jsonarray 数组,把每一个对象转成 json 对象 5 System.out.println(job.get("name")); 6 System.out.println(job.get("url")); }
相关文章推荐
- JSON数组解析代码样例
- JS解析json数据(如何将json字符串转化为数组)
- PHP 解析JSON数组
- JS解析json数据并将json字符串转化为数组的实现方法
- Json数组存入数据库与前台JS解析
- php使用js保存的json cookie 字符串,然后解析成数组,需要注意的事项
- (转)jquery each解析数组 json xml
- JS解析json数据(如何将json字符串转化为数组)
- jsoncpp解析拼装数组
- JS解析json数据(如何将json字符串转化为数组)
- JS解析json数据(如何将json字符串转化为数组)
- Android如何解析json数组对象
- JS解析json数据(如何将json字符串转化为数组)
- JS解析json数据(如何将json字符串转化为数组)
- JS解析json数据(如何将json字符串转化为数组)
- Flex解析Json数组
- [转载]jquery遍历筛选数组的几种方法和遍历解析json对象
- Android如何解析json数组对象
- js数组转json并在后台对其解析
- jquery遍历筛选数组的几种方法和遍历解析json对象