JSONObject.toBean() data转换

//toBean方法不识别date属性  要把VO的DATE该成UTIL包下的DATE 然后加上下面的代码。不然会报错
JSONUtils.getMorpherRegistry().registerMorpher(new DateMorpher(new String[] {"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss"}));
                
BaseConstantVO baseConstantVO = (BaseConstantVO) JSONObject.toBean(paramsJson, BaseConstantVO.class);

posted @ 2018-02-10 17:47  Bob.Xie  阅读(2217)  评论(0编辑  收藏  举报