Search in sources :

Example 1 with PropertyFilter

use of net.sf.json.util.PropertyFilter in project topcom-cloud by 545314690.

the class JsonUtil method getNoNullConfig.

public static JsonConfig getNoNullConfig() {
    JsonConfig config = new JsonConfig();
    config.setJsonPropertyFilter(new PropertyFilter() {

        @Override
        public boolean apply(Object o, String s, Object o1) {
            return o1 == null || o1.equals(JSONNull.getInstance());
        }
    });
    return config;
}
Also used : JsonConfig(net.sf.json.JsonConfig) PropertyFilter(net.sf.json.util.PropertyFilter) JSONObject(net.sf.json.JSONObject)

Aggregations

JSONObject (net.sf.json.JSONObject)1 JsonConfig (net.sf.json.JsonConfig)1 PropertyFilter (net.sf.json.util.PropertyFilter)1