HashMap JSONObject Iterator json解析转map

HashMap<String, Object> map = new HashMap<String, Object>();
JSONObject jsonObject = net.sf.json.JSONObject.fromObject(values);

Iterator keyIter = jsonObject.keys();
String key;
Object value;
while( keyIter.hasNext())
{
    key = (String)keyIter.next();
    value = jsonObject.get(key);
    map.put(key,value);
}
发布了20 篇原创文章 · 获赞 1 · 访问量 506

猜你喜欢

转载自blog.csdn.net/sunny_day_day/article/details/105190835