Commit f092fd87 by gechengyang

去掉AbstractModule Modules ModuleList中的@JsonFilter("fieldFilter")

parent 6319f3ee
......@@ -17,7 +17,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.*;
@JsonFilter("fieldFilter")
//@JsonFilter("fieldFilter")
@Module
public abstract class AbstractModule implements IModule, IModuleRoot {
......
......@@ -13,7 +13,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@JsonFilter("fieldFilter")
//@JsonFilter("fieldFilter")
public class ModuleList<T extends IModule> extends ArrayList<T> implements IModuleList<T> {
/**
*
......
......@@ -63,11 +63,11 @@ public class Modules {
public static ObjectMapper getObjectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
SimpleFilterProvider filterProvider = new SimpleFilterProvider();
// 在存盘的时候,不需要过滤字段,故 serializeAllExcept 不传参数
SimpleBeanPropertyFilter fieldFilter = SimpleBeanPropertyFilter.serializeAllExcept();
filterProvider.addFilter("fieldFilter", fieldFilter);
objectMapper.setFilterProvider(filterProvider);
// SimpleFilterProvider filterProvider = new SimpleFilterProvider();
// // 在存盘的时候,不需要过滤字段,故 serializeAllExcept 不传参数
// SimpleBeanPropertyFilter fieldFilter = SimpleBeanPropertyFilter.serializeAllExcept();
// filterProvider.addFilter("fieldFilter", fieldFilter);
// objectMapper.setFilterProvider(filterProvider);
return objectMapper;
}
......@@ -77,7 +77,7 @@ public class Modules {
String dataString = mapper.writeValueAsString(moduleOrList);
return dataString;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment