if (filter.containsKey("nodeData")) { JSONObject jsonObject = (JSONObject) filter.get("nodeData"); Iterator iterator = jsonObject.keySet().iterator(); while (iterator.hasNext()){ String next = (String) iterator.next(); Object o = jsonObject.get(next); filter.put(next,o); } }
filter是一个Map<String, Object>,
containsKey判断是否存在nodeDatakey
keySet获取jsonobject对象的key
jsonObject.get(next)获取对应value
标签:map,iterator,get,jsonobject,next,filter,key,jsonObject From: https://www.cnblogs.com/gsyy/p/17422584.html