JSONObject转换为map

http://cloudyxuq.iteye.com/blog/1618213

  1.   private static HashMap<String, String> toHashMap(Object object)  
  2.    {  
  3.        HashMap<String, String> data = new HashMap<String, String>();  
  4.        // 将json字符串转换成jsonObject  
  5.        JSONObject jsonObject = JSONObject.fromObject(object);  
  6.        Iterator it = jsonObject.keys();  
  7.        // 遍历jsonObject数据,添加到Map对象  
  8.        while (it.hasNext())  
  9.        {  
  10.            String key = String.valueOf(it.next());  
  11.            String value = (String) jsonObject.get(key);  
  12.            data.put(key, value);  
  13.        }  
  14.        return data;  
  15.    }  
原文地址:https://www.cnblogs.com/jcz1206/p/6030061.html