Package dev.enola.common.jackson
Class ObjectMappers
java.lang.Object
dev.enola.common.jackson.ObjectMappers
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigure(com.fasterxml.jackson.databind.ObjectMapper mapper) Configure the given ObjectMapper with Enola-specific settings.static com.fasterxml.jackson.databind.ObjectMapperCreates a new JSONObjectMapperpre-configured with Enola defaults.
-
Field Details
-
JSON
A shared, thread-safe, "immutable" default JSONObjectMapperinstance.This instance MUST NOT be reconfigured (e.g. by calling
ObjectMapper.configure(com.fasterxml.jackson.databind.DeserializationFeature, boolean)or similar methods) because it is shared.If you need a specific configuration, use
newJsonObjectMapper()to obtain a separate new instance, configure it, and then keep it for re-use. -
YAML
-
-
Method Details
-
newJsonObjectMapper
Creates a new JSONObjectMapperpre-configured with Enola defaults.The returned instance is a new separate object which can be safely re-configured (e.g. to set
DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIESto false).It is recommended to keep and re-use the obtained instance for performance reasons.
-
configure
Configure the given ObjectMapper with Enola-specific settings.
-