JsonGenerationException, JsonMappingException, IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
mapper.configure(SerializationConfig.Feature.USE_ANNOTATIONS, true);
if (ignoreConfigs) {
FilterProvider filters = new SimpleFilterProvider().addFilter(
"propertiesfilter",
SimpleBeanPropertyFilter.serializeAllExcept("properties"));
mapper.setFilters(filters);
} else {
FilterProvider filters = new SimpleFilterProvider().addFilter(
"propertiesfilter", SimpleBeanPropertyFilter.serializeAllExcept());
mapper.setFilters(filters);
}
String json = mapper.writeValueAsString(object);
return json;