private static < T extends ObjectMapper > T initializeObjectMapper ( T mapper ) { mapper . configure ( SerializationFeature . WRITE_DATES_AS_TIMESTAMPS , false ) . configure ( SerializationFeature . WRITE_EMPTY_JSON_ARRAYS , true ) . configure ( SerializationFeature . FAIL_ON_EMPTY_BEANS , false ) . configure ( DeserializationFeature . ACCEPT_EMPTY_STRING_AS_NULL_OBJECT , true ) . configure ( DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , false ) . configure ( DeserializationFeature . ACCEPT_SINGLE_VALUE_AS_ARRAY , true ) . setSerializationInclusion ( JsonInclude . Include . NON_NULL ) . registerModule ( new JavaTimeModule ( ) ) . registerModule ( ByteArraySerializer . getModule ( ) ) . registerModule ( Base64UrlSerializer . getModule ( ) ) . registerModule ( DateTimeSerializer . getModule ( ) ) . registerModule ( DateTimeRfc1123Serializer . getModule ( ) ) . registerModule ( DurationSerializer . getModule ( ) ) ; mapper . setVisibility ( mapper . getSerializationConfig ( ) . getDefaultVisibilityChecker ( ) . withFieldVisibility ( JsonAutoDetect . Visibility . ANY ) . withSetterVisibility ( JsonAutoDetect . Visibility . NONE ) . withGetterVisibility ( JsonAutoDetect . Visibility . NONE ) . withIsGetterVisibility ( JsonAutoDetect . Visibility . NONE ) ) ; return mapper ; }
Initializes an instance of JacksonMapperAdapter with default configurations applied to the object mapper .