JsonConfig jsonConfig = new JsonConfig();
jsonConfig.registerDefaultValueProcessor(Integer.class, //定义Integer为null时 转为json 还是null
new DefaultValueProcessor(){
public Object getDefaultValue(Class type) {
return null;
}
});
JSONObject json = JSONObject.fromObject(JavaBean,jsonConfig);JavaBean中Integer类型为null时,转为json依然为null
最新推荐文章于 2023-11-07 12:02:31 发布
9297

被折叠的 条评论
为什么被折叠?



