日期:2014-05-20 浏览次数:20694 次
public class JSONParaser { //将Bean转成JSON public static JSONObject getJSON(Object content){ try{ JSONObject result = JSONObject.fromObject(content); return result; } catch(Exception ex){ return null; } } //JSON字符串转成Bean public static Object getString(String json){ try{ JSONObject jobj=JSONObject.fromObject(json); return JSONObject.toBean(jobj); } catch(Exception ex){ return null; } } }