JSONArray数据
[{ "allname": "根节点", "parent": "#", "code": "", "licensePlateNumber": "", "id": "0", "text": "根节点", "dept": "0", "useCarMoney": "1" }, { "allname": "工会经费", "parent": "0", "code": "0", "licensePlateNumber": "", "id": "0528bd30-275f-4081-913b-2cfbd8c23809", "text": "工会经费(全部)", "dept": "全部", "useCarMoney": "1" }, { "allname": "政府采购", "parent": "0", "code": "3", "licensePlateNumber": "冀D9999", "id": "47ef40ef-9533-4a51-bc19-3e7d4c52a3a2", "text": "政府采购(YXWHC)", "dept": "YXWHC", "useCarMoney": "0" }]
java 后台方法
JSONArray arr = treeService.findAllIndexToJson(); Iterator<Object> it = arr.iterator(); while (it.hasNext()) { JSONObject ob = (JSONObject) it.next(); if(ob.getString("text")!=null){ String text=ob.getString("text"); //此处可根据getString()/getDate()等方法拿到每个josn对象的值 } }
标签: java
文章来源:
不凡
版权声明:本站所发布的全部内容源于互联网搬运,仅供用于学习和交流,如果有侵权之处请第一时间联系我们删除。敬请谅解! E-mail:xujinxiao@126.com
还木有评论哦,快来抢沙发吧~