JsonConfig jsonConfig= new JsonConfig();
jsonConfig.setExcludes(new String[]{"xxxx"});
return JSONObject.fromObject(obj, jsonConfig);
xxxx:需要过滤的属性
obj:转换的类
JsonConfig jsonConfig= new JsonConfig();
jsonConfig.setExcludes(new String[]{"xxxx"});
return JSONObject.fromObject(obj, jsonConfig);
xxxx:需要过滤的属性
obj:转换的类
转载于:https://my.oschina.net/u/3072263/blog/801874