org.springframework.http.converter.json

## Class Jackson2ObjectMapperBuilder

- java.lang.Object
- - org.springframework.http.converter.json.Jackson2ObjectMapperBuilder

-     public class Jackson2ObjectMapperBuilder
      extends Object

  A builder used to create `ObjectMapper` instances with a fluent API.

  It customizes Jackson's default properties with the following ones:

  - `MapperFeature.DEFAULT_VIEW_INCLUSION` is disabled
  - `DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES` is disabled

  It also automatically registers the following well-known modules if they are detected on the classpath:

  - jackson-datatype-jdk8: support for other Java 8 types like `Optional`
  - jackson-datatype-jsr310: support for Java 8 Date & Time API types
  - jackson-datatype-joda: support for Joda-Time types
  - jackson-module-kotlin: support for Kotlin classes and data classes

  Compatible with Jackson 2.9 to 2.12, as of Spring 5.3.

  Since:
    4.1.1
  Author:
    Sebastien Deleuze, Juergen Hoeller, Tadaya Tsuyukubo, Eddú Meléndez
  See Also:
    `build()`, `configure(ObjectMapper)`, `Jackson2ObjectMapperFactoryBean`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Jackson2ObjectMapperBuilder()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Jackson2ObjectMapperBuilder` | `annotationIntrospector(AnnotationIntrospector annotationIntrospector)` Set an `AnnotationIntrospector` for both serialization and deserialization.
    `Jackson2ObjectMapperBuilder` | `annotationIntrospector(Function<AnnotationIntrospector,AnnotationIntrospector> pairingFunction)` Alternative to `annotationIntrospector(AnnotationIntrospector)` that allows combining with rather than replacing the currently set introspector, e.g.
    `Jackson2ObjectMapperBuilder` | `applicationContext(ApplicationContext applicationContext)` Set the Spring `ApplicationContext` in order to autowire Jackson handlers (`JsonSerializer`, `JsonDeserializer`, `KeyDeserializer`, `TypeResolverBuilder` and `TypeIdResolver`).
    `Jackson2ObjectMapperBuilder` | `autoDetectFields(boolean autoDetectFields)` Shortcut for `MapperFeature.AUTO_DETECT_FIELDS` option.
    `Jackson2ObjectMapperBuilder` | `autoDetectGettersSetters(boolean autoDetectGettersSetters)` Shortcut for `MapperFeature.AUTO_DETECT_SETTERS`/ `MapperFeature.AUTO_DETECT_GETTERS`/`MapperFeature.AUTO_DETECT_IS_GETTERS` options.
    `<T extends ObjectMapper> T` | `build()` Build a new `ObjectMapper` instance.
    `static Jackson2ObjectMapperBuilder` | `cbor()` Obtain a `Jackson2ObjectMapperBuilder` instance in order to build a CBOR data format `ObjectMapper` instance.
    `void` | `configure(ObjectMapper objectMapper)` Configure an existing `ObjectMapper` instance with this builder's settings.
    `Jackson2ObjectMapperBuilder` | `createXmlMapper(boolean createXmlMapper)` If set to `true`, an `XmlMapper` will be created using its default constructor.
    `Jackson2ObjectMapperBuilder` | `dateFormat(DateFormat dateFormat)` Define the format for date/time with the given `DateFormat`.
    `Jackson2ObjectMapperBuilder` | `defaultTyping(TypeResolverBuilder<?> typeResolverBuilder)` Specify a `TypeResolverBuilder` to use for Jackson's default typing.
    `Jackson2ObjectMapperBuilder` | `defaultUseWrapper(boolean defaultUseWrapper)` Define if a wrapper will be used for indexed (List, array) properties or not by default (only applies to `XmlMapper`).
    `Jackson2ObjectMapperBuilder` | `defaultViewInclusion(boolean defaultViewInclusion)` Shortcut for `MapperFeature.DEFAULT_VIEW_INCLUSION` option.
    `Jackson2ObjectMapperBuilder` | `deserializerByType(Class<?> type, JsonDeserializer<?> deserializer)` Configure a custom deserializer for the given type.
    `Jackson2ObjectMapperBuilder` | `deserializers(JsonDeserializer<?>... deserializers)` Configure custom deserializers.
    `Jackson2ObjectMapperBuilder` | `deserializersByType(Map<Class<?>,JsonDeserializer<?>> deserializers)` Configure custom deserializers for the given types.
    `Jackson2ObjectMapperBuilder` | `factory(JsonFactory factory)` Define the `JsonFactory` to be used to create the `ObjectMapper` instance.
    `Jackson2ObjectMapperBuilder` | `failOnEmptyBeans(boolean failOnEmptyBeans)` Shortcut for `SerializationFeature.FAIL_ON_EMPTY_BEANS` option.
    `Jackson2ObjectMapperBuilder` | `failOnUnknownProperties(boolean failOnUnknownProperties)` Shortcut for `DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES` option.
    `Jackson2ObjectMapperBuilder` | `featuresToDisable(Object... featuresToDisable)` Specify features to disable.
    `Jackson2ObjectMapperBuilder` | `featuresToEnable(Object... featuresToEnable)` Specify features to enable.
    `Jackson2ObjectMapperBuilder` | `filters(FilterProvider filters)` Set the global filters to use in order to support `@JsonFilter` annotated POJO.
    `Jackson2ObjectMapperBuilder` | `findModulesViaServiceLoader(boolean findModules)` Set whether to let Jackson find available modules via the JDK ServiceLoader, based on META-INF metadata in the classpath.
    `Jackson2ObjectMapperBuilder` | `handlerInstantiator(HandlerInstantiator handlerInstantiator)` Customize the construction of Jackson handlers (`JsonSerializer`, `JsonDeserializer`, `KeyDeserializer`, `TypeResolverBuilder` and `TypeIdResolver`).
    `Jackson2ObjectMapperBuilder` | `indentOutput(boolean indentOutput)` Shortcut for `SerializationFeature.INDENT_OUTPUT` option.
    `static Jackson2ObjectMapperBuilder` | `json()` Obtain a `Jackson2ObjectMapperBuilder` instance in order to build a regular JSON `ObjectMapper` instance.
    `Jackson2ObjectMapperBuilder` | `locale(Locale locale)` Override the default `Locale` to use for formatting.
    `Jackson2ObjectMapperBuilder` | `locale(String localeString)` Override the default `Locale` to use for formatting.
    `Jackson2ObjectMapperBuilder` | `mixIn(Class<?> target, Class<?> mixinSource)` Add mix-in annotations to use for augmenting specified class or interface.
    `Jackson2ObjectMapperBuilder` | `mixIns(Map<Class<?>,Class<?>> mixIns)` Add mix-in annotations to use for augmenting specified class or interface.
    `Jackson2ObjectMapperBuilder` | `moduleClassLoader(ClassLoader moduleClassLoader)` Set the ClassLoader to use for loading Jackson extension modules.
    `Jackson2ObjectMapperBuilder` | `modules(Consumer<List<Module>> consumer)` Variant of `modules(Module...)` with a `Consumer` for full control over the underlying list of modules.
    `Jackson2ObjectMapperBuilder` | `modules(List<Module> modules)` Variant of `modules(Module...)` with a `List`.
    `Jackson2ObjectMapperBuilder` | `modules(Module... modules)` Specify the modules to be registered with the `ObjectMapper`.
    `Jackson2ObjectMapperBuilder` | `modulesToInstall(Class<? extends Module>... modules)` Specify one or more modules by class to be registered with the `ObjectMapper`.
    `Jackson2ObjectMapperBuilder` | `modulesToInstall(Consumer<List<Module>> consumer)` Variant of `modulesToInstall(Module...)` with a `Consumer` for full control over the underlying list of modules.
    `Jackson2ObjectMapperBuilder` | `modulesToInstall(Module... modules)` Specify one or more modules to be registered with the `ObjectMapper`.
    `Jackson2ObjectMapperBuilder` | `postConfigurer(Consumer<ObjectMapper> configurer)` An option to apply additional customizations directly to the `ObjectMapper` instances at the end, after all other config properties of the builder have been applied.
    `Jackson2ObjectMapperBuilder` | `propertyNamingStrategy(PropertyNamingStrategy propertyNamingStrategy)` Specify a `PropertyNamingStrategy` to configure the `ObjectMapper` with.
    `Jackson2ObjectMapperBuilder` | `serializationInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include inclusion)` Set a custom inclusion strategy for serialization.
    `Jackson2ObjectMapperBuilder` | `serializationInclusion(com.fasterxml.jackson.annotation.JsonInclude.Value serializationInclusion)` Set a custom inclusion strategy for serialization.
    `Jackson2ObjectMapperBuilder` | `serializerByType(Class<?> type, JsonSerializer<?> serializer)` Configure a custom serializer for the given type.
    `Jackson2ObjectMapperBuilder` | `serializers(JsonSerializer<?>... serializers)` Configure custom serializers.
    `Jackson2ObjectMapperBuilder` | `serializersByType(Map<Class<?>,JsonSerializer<?>> serializers)` Configure custom serializers for the given types.
    `Jackson2ObjectMapperBuilder` | `simpleDateFormat(String format)` Define the date/time format with a `SimpleDateFormat`.
    `static Jackson2ObjectMapperBuilder` | `smile()` Obtain a `Jackson2ObjectMapperBuilder` instance in order to build a Smile data format `ObjectMapper` instance.
    `Jackson2ObjectMapperBuilder` | `timeZone(String timeZoneString)` Override the default `TimeZone` to use for formatting.
    `Jackson2ObjectMapperBuilder` | `timeZone(TimeZone timeZone)` Override the default `TimeZone` to use for formatting.
    `Jackson2ObjectMapperBuilder` | `visibility(com.fasterxml.jackson.annotation.PropertyAccessor accessor, com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility visibility)` Specify visibility to limit what kind of properties are auto-detected.
    `static Jackson2ObjectMapperBuilder` | `xml()` Obtain a `Jackson2ObjectMapperBuilder` instance in order to build an `XmlMapper` instance.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Jackson2ObjectMapperBuilder

          public Jackson2ObjectMapperBuilder()

  - ### Method Detail

    - #### createXmlMapper

          public Jackson2ObjectMapperBuilder createXmlMapper(boolean createXmlMapper)

      If set to `true`, an `XmlMapper` will be created using its default constructor. This is only applicable to `build()` calls, not to `configure(com.fasterxml.jackson.databind.ObjectMapper)` calls.

    - #### factory

          public Jackson2ObjectMapperBuilder factory(JsonFactory factory)

      Define the `JsonFactory` to be used to create the `ObjectMapper` instance.
      Since:
        5.0

    - #### dateFormat

          public Jackson2ObjectMapperBuilder dateFormat(DateFormat dateFormat)

      Define the format for date/time with the given `DateFormat`.

      Note: Setting this property makes the exposed `ObjectMapper` non-thread-safe, according to Jackson's thread safety rules.

      See Also:
        `simpleDateFormat(String)`

    - #### simpleDateFormat

          public Jackson2ObjectMapperBuilder simpleDateFormat(String format)

      Define the date/time format with a `SimpleDateFormat`.

      Note: Setting this property makes the exposed `ObjectMapper` non-thread-safe, according to Jackson's thread safety rules.

      See Also:
        `dateFormat(DateFormat)`

    - #### locale

          public Jackson2ObjectMapperBuilder locale(Locale locale)

      Override the default `Locale` to use for formatting. Default value used is `Locale.getDefault()`.
      Since:
        4.1.5

    - #### locale

          public Jackson2ObjectMapperBuilder locale(String localeString)

      Override the default `Locale` to use for formatting. Default value used is `Locale.getDefault()`.
      Parameters:
        `localeString` - the locale ID as a String representation
      Since:
        4.1.5

    - #### timeZone

          public Jackson2ObjectMapperBuilder timeZone(TimeZone timeZone)

      Override the default `TimeZone` to use for formatting. Default value used is UTC (NOT local timezone).
      Since:
        4.1.5

    - #### timeZone

          public Jackson2ObjectMapperBuilder timeZone(String timeZoneString)

      Override the default `TimeZone` to use for formatting. Default value used is UTC (NOT local timezone).
      Parameters:
        `timeZoneString` - the zone ID as a String representation
      Since:
        4.1.5

    - #### annotationIntrospector

          public Jackson2ObjectMapperBuilder annotationIntrospector(AnnotationIntrospector annotationIntrospector)

      Set an `AnnotationIntrospector` for both serialization and deserialization.

    - #### annotationIntrospector

          public Jackson2ObjectMapperBuilder annotationIntrospector(Function<AnnotationIntrospector,AnnotationIntrospector> pairingFunction)

      Alternative to `annotationIntrospector(AnnotationIntrospector)` that allows combining with rather than replacing the currently set introspector, e.g. via `AnnotationIntrospector.pair(AnnotationIntrospector, AnnotationIntrospector)`.
      Parameters:
        `pairingFunction` - a function to apply to the currently set introspector (possibly `null`); the result of the function becomes the new introspector.
      Since:
        5.2.4

    - #### propertyNamingStrategy

          public Jackson2ObjectMapperBuilder propertyNamingStrategy(PropertyNamingStrategy propertyNamingStrategy)

      Specify a `PropertyNamingStrategy` to configure the `ObjectMapper` with.

    - #### defaultTyping

          public Jackson2ObjectMapperBuilder defaultTyping(TypeResolverBuilder<?> typeResolverBuilder)

      Specify a `TypeResolverBuilder` to use for Jackson's default typing.
      Since:
        4.2.2

    - #### serializationInclusion

          public Jackson2ObjectMapperBuilder serializationInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include inclusion)

      Set a custom inclusion strategy for serialization.
      See Also:
        `JsonInclude.Include`

    - #### serializationInclusion

          public Jackson2ObjectMapperBuilder serializationInclusion(com.fasterxml.jackson.annotation.JsonInclude.Value serializationInclusion)

      Set a custom inclusion strategy for serialization.
      Since:
        5.3
      See Also:
        `JsonInclude.Value`

    - #### filters

          public Jackson2ObjectMapperBuilder filters(FilterProvider filters)

      Set the global filters to use in order to support `@JsonFilter` annotated POJO.
      Since:
        4.2
      See Also:
        `MappingJacksonValue.setFilters(FilterProvider)`

    - #### mixIn

          public Jackson2ObjectMapperBuilder mixIn(Class<?> target,
                                                   Class<?> mixinSource)

      Add mix-in annotations to use for augmenting specified class or interface.
      Parameters:
        `target` - class (or interface) whose annotations to effectively override
        `mixinSource` - class (or interface) whose annotations are to be "added" to target's annotations as value
      Since:
        4.1.2
      See Also:
        `ObjectMapper.addMixIn(Class, Class)`

    - #### mixIns

          public Jackson2ObjectMapperBuilder mixIns(Map<Class<?>,Class<?>> mixIns)

      Add mix-in annotations to use for augmenting specified class or interface.
      Parameters:
        `mixIns` - a Map of entries with target classes (or interface) whose annotations to effectively override as key and mix-in classes (or interface) whose annotations are to be "added" to target's annotations as value.
      Since:
        4.1.2
      See Also:
        `ObjectMapper.addMixIn(Class, Class)`

    - #### serializers

          public Jackson2ObjectMapperBuilder serializers(JsonSerializer<?>... serializers)

      Configure custom serializers. Each serializer is registered for the type returned by `JsonSerializer.handledType()`, which must not be `null`.
      See Also:
        `serializersByType(Map)`

    - #### serializerByType

          public Jackson2ObjectMapperBuilder serializerByType(Class<?> type,
                                                              JsonSerializer<?> serializer)

      Configure a custom serializer for the given type.
      Since:
        4.1.2
      See Also:
        `serializers(JsonSerializer...)`

    - #### serializersByType

          public Jackson2ObjectMapperBuilder serializersByType(Map<Class<?>,JsonSerializer<?>> serializers)

      Configure custom serializers for the given types.
      See Also:
        `serializers(JsonSerializer...)`

    - #### deserializers

          public Jackson2ObjectMapperBuilder deserializers(JsonDeserializer<?>... deserializers)

      Configure custom deserializers. Each deserializer is registered for the type returned by `JsonDeserializer.handledType()`, which must not be `null`.
      Since:
        4.3
      See Also:
        `deserializersByType(Map)`

    - #### deserializerByType

          public Jackson2ObjectMapperBuilder deserializerByType(Class<?> type,
                                                                JsonDeserializer<?> deserializer)

      Configure a custom deserializer for the given type.
      Since:
        4.1.2

    - #### deserializersByType

          public Jackson2ObjectMapperBuilder deserializersByType(Map<Class<?>,JsonDeserializer<?>> deserializers)

      Configure custom deserializers for the given types.

    - #### autoDetectFields

          public Jackson2ObjectMapperBuilder autoDetectFields(boolean autoDetectFields)

      Shortcut for `MapperFeature.AUTO_DETECT_FIELDS` option.

    - #### autoDetectGettersSetters

          public Jackson2ObjectMapperBuilder autoDetectGettersSetters(boolean autoDetectGettersSetters)

      Shortcut for `MapperFeature.AUTO_DETECT_SETTERS`/ `MapperFeature.AUTO_DETECT_GETTERS`/`MapperFeature.AUTO_DETECT_IS_GETTERS` options.

    - #### defaultViewInclusion

          public Jackson2ObjectMapperBuilder defaultViewInclusion(boolean defaultViewInclusion)

      Shortcut for `MapperFeature.DEFAULT_VIEW_INCLUSION` option.

    - #### failOnUnknownProperties

          public Jackson2ObjectMapperBuilder failOnUnknownProperties(boolean failOnUnknownProperties)

      Shortcut for `DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES` option.

    - #### failOnEmptyBeans

          public Jackson2ObjectMapperBuilder failOnEmptyBeans(boolean failOnEmptyBeans)

      Shortcut for `SerializationFeature.FAIL_ON_EMPTY_BEANS` option.

    - #### indentOutput

          public Jackson2ObjectMapperBuilder indentOutput(boolean indentOutput)

      Shortcut for `SerializationFeature.INDENT_OUTPUT` option.

    - #### defaultUseWrapper

          public Jackson2ObjectMapperBuilder defaultUseWrapper(boolean defaultUseWrapper)

      Define if a wrapper will be used for indexed (List, array) properties or not by default (only applies to `XmlMapper`).
      Since:
        4.3

    - #### visibility

          public Jackson2ObjectMapperBuilder visibility(com.fasterxml.jackson.annotation.PropertyAccessor accessor,
                                                        com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility visibility)

      Specify visibility to limit what kind of properties are auto-detected.
      Since:
        5.1
      See Also:
        `PropertyAccessor`, `JsonAutoDetect.Visibility`

    - #### featuresToEnable

          public Jackson2ObjectMapperBuilder featuresToEnable(Object... featuresToEnable)

      Specify features to enable.
      See Also:
        `JsonParser.Feature`, `JsonGenerator.Feature`, `SerializationFeature`, `DeserializationFeature`, `MapperFeature`

    - #### featuresToDisable

          public Jackson2ObjectMapperBuilder featuresToDisable(Object... featuresToDisable)

      Specify features to disable.
      See Also:
        `JsonParser.Feature`, `JsonGenerator.Feature`, `SerializationFeature`, `DeserializationFeature`, `MapperFeature`

    - #### modules

          public Jackson2ObjectMapperBuilder modules(Module... modules)

      Specify the modules to be registered with the `ObjectMapper`.

      Multiple invocations are not additive, the last one defines the modules to register.

      Note: If this is set, no finding of modules is going to happen - not by Jackson, and not by Spring either (see `findModulesViaServiceLoader`). As a consequence, specifying an empty list here will suppress any kind of module detection.

      Specify either this or `modulesToInstall(com.fasterxml.jackson.databind.Module...)`, not both.

      Since:
        4.1.5
      See Also:
        `modules(List)`, `Module`

    - #### modules

          public Jackson2ObjectMapperBuilder modules(List<Module> modules)

      Variant of `modules(Module...)` with a `List`.
      See Also:
        `modules(Module...)`, `modules(Consumer)`, `Module`

    - #### modules

          public Jackson2ObjectMapperBuilder modules(Consumer<List<Module>> consumer)

      Variant of `modules(Module...)` with a `Consumer` for full control over the underlying list of modules.
      Since:
        5.3.22
      See Also:
        `modules(Module...)`, `modules(List)`, `Module`

    - #### modulesToInstall

          public Jackson2ObjectMapperBuilder modulesToInstall(Module... modules)

      Specify one or more modules to be registered with the `ObjectMapper`.

      Multiple invocations are not additive, the last one defines the modules to register.

      Modules specified here will be registered after Spring's autodetection of JSR-310 and Joda-Time, or Jackson's finding of modules (see `findModulesViaServiceLoader`), allowing to eventually override their configuration.

      Specify either this or `modules(Module...)`, not both.

      Since:
        4.1.5
      See Also:
        `modulesToInstall(Consumer)`, `modulesToInstall(Class...)`, `Module`

    - #### modulesToInstall

          public Jackson2ObjectMapperBuilder modulesToInstall(Consumer<List<Module>> consumer)

      Variant of `modulesToInstall(Module...)` with a `Consumer` for full control over the underlying list of modules.
      Since:
        5.3.22
      See Also:
        `modulesToInstall(Module...)`, `modulesToInstall(Class...)`, `Module`

    - #### modulesToInstall

          @SafeVarargs
          public final Jackson2ObjectMapperBuilder modulesToInstall(Class<? extends Module>... modules)

      Specify one or more modules by class to be registered with the `ObjectMapper`.

      Multiple invocations are not additive, the last one defines the modules to register.

      Modules specified here will be registered after Spring's autodetection of JSR-310 and Joda-Time, or Jackson's finding of modules (see `findModulesViaServiceLoader`), allowing to eventually override their configuration.

      Specify either this or `modules(Module...)`, not both.

      See Also:
        `modulesToInstall(Module...)`, `modulesToInstall(Consumer)`, `Module`

    - #### findModulesViaServiceLoader

          public Jackson2ObjectMapperBuilder findModulesViaServiceLoader(boolean findModules)

      Set whether to let Jackson find available modules via the JDK ServiceLoader, based on META-INF metadata in the classpath.

      If this mode is not set, Spring's Jackson2ObjectMapperBuilder itself will try to find the JSR-310 and Joda-Time support modules on the classpath - provided that Java 8 and Joda-Time themselves are available, respectively.

      See Also:
        `ObjectMapper.findModules()`

    - #### moduleClassLoader

          public Jackson2ObjectMapperBuilder moduleClassLoader(ClassLoader moduleClassLoader)

      Set the ClassLoader to use for loading Jackson extension modules.

    - #### handlerInstantiator

          public Jackson2ObjectMapperBuilder handlerInstantiator(HandlerInstantiator handlerInstantiator)

      Customize the construction of Jackson handlers (`JsonSerializer`, `JsonDeserializer`, `KeyDeserializer`, `TypeResolverBuilder` and `TypeIdResolver`).
      Since:
        4.1.3
      See Also:
        `applicationContext(ApplicationContext)`

    - #### applicationContext

          public Jackson2ObjectMapperBuilder applicationContext(ApplicationContext applicationContext)

      Set the Spring `ApplicationContext` in order to autowire Jackson handlers (`JsonSerializer`, `JsonDeserializer`, `KeyDeserializer`, `TypeResolverBuilder` and `TypeIdResolver`).
      Since:
        4.1.3
      See Also:
        `SpringHandlerInstantiator`

    - #### postConfigurer

          public Jackson2ObjectMapperBuilder postConfigurer(Consumer<ObjectMapper> configurer)

      An option to apply additional customizations directly to the `ObjectMapper` instances at the end, after all other config properties of the builder have been applied.
      Parameters:
        `configurer` - a configurer to apply. If several configurers are registered, they will get applied in their registration order.
      Since:
        5.3

    - #### build

          public <T extends ObjectMapper> T build()

      Build a new `ObjectMapper` instance.

      Each build operation produces an independent `ObjectMapper` instance. The builder's settings can get modified, with a subsequent build operation then producing a new `ObjectMapper` based on the most recent settings.

      Returns:
        the newly built ObjectMapper

    - #### configure

          public void configure(ObjectMapper objectMapper)

      Configure an existing `ObjectMapper` instance with this builder's settings. This can be applied to any number of `ObjectMappers`.
      Parameters:
        `objectMapper` - the ObjectMapper to configure

    - #### json

          public static Jackson2ObjectMapperBuilder json()

      Obtain a `Jackson2ObjectMapperBuilder` instance in order to build a regular JSON `ObjectMapper` instance.

    - #### xml

          public static Jackson2ObjectMapperBuilder xml()

      Obtain a `Jackson2ObjectMapperBuilder` instance in order to build an `XmlMapper` instance.

    - #### smile

          public static Jackson2ObjectMapperBuilder smile()

      Obtain a `Jackson2ObjectMapperBuilder` instance in order to build a Smile data format `ObjectMapper` instance.
      Since:
        5.0

    - #### cbor

          public static Jackson2ObjectMapperBuilder cbor()

      Obtain a `Jackson2ObjectMapperBuilder` instance in order to build a CBOR data format `ObjectMapper` instance.
      Since:
        5.0