public class List2Json { ???public static JSONArray ProLogList2Json(List<ProgramLog> list){ ????????JSONArray json = new JSONArray(); ????????for(ProgramLog pLog : list){ ????????????JSONObject jo = new JSONObject(); ????????????jo.put("id", pLog.getId()); ????????????jo.put("time", pLog.getBeginTime()); ??????????????????????????json.put(jo); ????????} ????????return json; ???}
list转为json
原文地址:http://www.cnblogs.com/weyine/p/7616255.html