use of com.fasterxml.jackson.databind.ser.PropertyWriter in project eureka by Netflix.
the class AbstractEurekaJacksonCodec method bindAmazonInfoFilter.
private void bindAmazonInfoFilter(ObjectMapper mapper) {
SimpleFilterProvider filters = new SimpleFilterProvider();
final String filterName = "exclude-amazon-info-entries";
mapper.setAnnotationIntrospector(new JacksonAnnotationIntrospector() {
@Override
public Object findFilterId(Annotated a) {
if (Map.class.isAssignableFrom(a.getRawType())) {
return filterName;
}
return super.findFilterId(a);
}
});
filters.addFilter(filterName, new SimpleBeanPropertyFilter() {
@Override
protected boolean include(BeanPropertyWriter writer) {
return true;
}
@Override
protected boolean include(PropertyWriter writer) {
return MINI_AMAZON_INFO_INCLUDE_KEYS.contains(writer.getName());
}
});
mapper.setFilters(filters);
}
Aggregations