use of com.fasterxml.jackson.databind.annotation.JsonNaming in project SchemaCrawler by schemacrawler.
the class BaseJacksonSerializedCatalog method newConfiguredObjectMapper.
private ObjectMapper newConfiguredObjectMapper() {
@JsonIgnoreProperties({ "parent", "referenced-column", "exported-foreign-keys", "imported-foreign-keys" })
@JsonPropertyOrder(value = { "@uuid", "name", "short-name", "full-name", "crawl-info", "schema-crawler-info", "jvm-system-info", "operating-system-info", "database-info", "jdbc-driver-info", "schemas", "system-column-data-types", "column-data-types", "all-table-columns" }, alphabetic = true)
@JsonIdentityInfo(generator = ObjectIdGenerators.UUIDGenerator.class, property = "@uuid")
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy.class)
@JsonFilter("ignore-getter-errors-filter")
class JacksonAnnotationMixIn {
}
final FilterProvider filters = new SimpleFilterProvider().addFilter("ignore-getter-errors-filter", (PropertyFilter) new IgnoreExceptionBeanPropertyFilter());
final ObjectMapper mapper = newObjectMapper();
mapper.enable(ORDER_MAP_ENTRIES_BY_KEYS, INDENT_OUTPUT, USE_EQUALITY_FOR_OBJECT_ID, WRITE_ENUMS_USING_TO_STRING);
mapper.registerModule(new JavaTimeModule());
mapper.addMixIn(Object.class, JacksonAnnotationMixIn.class);
mapper.setFilterProvider(filters);
return mapper;
}
use of com.fasterxml.jackson.databind.annotation.JsonNaming in project SchemaCrawler by schemacrawler.
the class BaseLintReportJacksonBuilder method newConfiguredObjectMapper.
private ObjectMapper newConfiguredObjectMapper() {
@JsonPropertyOrder(alphabetic = true)
@JsonNaming(PropertyNamingStrategies.KebabCaseStrategy.class)
abstract class JacksonAnnotationMixIn {
@JsonIgnore
public Object value;
@JsonProperty("value")
public abstract Object getValueAsString();
}
final JavaTimeModule timeModule = new JavaTimeModule();
timeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
final ObjectMapper mapper = newObjectMapper();
mapper.enable(ORDER_MAP_ENTRIES_BY_KEYS, INDENT_OUTPUT, USE_EQUALITY_FOR_OBJECT_ID, WRITE_ENUMS_USING_TO_STRING);
mapper.addMixIn(Object.class, JacksonAnnotationMixIn.class);
mapper.addMixIn(Lint.class, JacksonAnnotationMixIn.class);
mapper.registerModule(timeModule);
return mapper;
}
Aggregations