2013年5月18日

摘要: 需求:在我们的项目里希望JsonString传入日期类型值为空时,JSONObject.toBean时可以将Java对象的该日期属性设为null。解决过程:json-lib反序列化Json字符串为Java对象,可以通过以下代码处理日期字段: public static <T> T JsonToBean(Class<T> clazz, String JsonString) { JSONUtils.getMorpherRegistry().registerMorpher( new DateMorpher(new String[] { "yyyy-M... 阅读全文
posted @ 2013-05-18 20:37 我的台词很简单 阅读(7927) 评论(1) 推荐(0) 编辑

导航