json 遍历

private Map getUCData(JSONObject data) {
		Map<String, String> map = new HashMap<String, String>();
		String dataStr = "";
		if (log.isDebugEnabled()) {
			log.debug("obj:" + data);
		}
		for (Iterator<?> iter = data.keys(); iter.hasNext();) {
			String key = (String) iter.next();
			try {
				map.put(key, data.get(key).toString());

			} catch (JSONException e) {
				e.printStackTrace();
			}
		}
		return map;
	}

 

你可能感兴趣的:(java json排序)