代码如下: JSONObject json=new JSONObject(); JsonConfig config = new JsonConfig(); config.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor("yyyy-MM-dd")); JSONArray jsonArray=JSONArray.fromObject(list,config); Map<String, Object> map=new HashMap<String, Object>(); map.put("code", 0); map.put("msg", ""); |
JSONObject(JSON与对象的转换)以及JsonConfig使用说明
最新推荐文章于 2024-05-20 11:36:40 发布