Class ObjectMapperConfigurer

java.lang.Object
org.mongojack.ObjectMapperConfigurer

public class ObjectMapperConfigurer extends Object
Can be used by OSGi containers (or anyone else) to configure a custom ObjectMapper instance. This is necessary because MongoJackModule is in the internal module, but it also can be used by any caller to avoid using the "internal" implementations.
  • Method Details

    • configureObjectMapper

      public static tools.jackson.databind.ObjectMapper configureObjectMapper(tools.jackson.databind.ObjectMapper mapper)
      Install the MongoJackModule into the object mapper with recommended settings. Also installs JavaTimeModule.
      Parameters:
      mapper -
      Returns:
    • configureObjectMapper

      public static tools.jackson.databind.ObjectMapper configureObjectMapper(tools.jackson.databind.ObjectMapper mapper, MongoJackModuleConfiguration moduleConfiguration)
      Install the MongoJackModule into the object mapper with recommended settings. Also installs JavaTimeModule.
      Parameters:
      mapper -
      Returns:
    • addMongojackModuleOnly

      public static tools.jackson.databind.ObjectMapper addMongojackModuleOnly(tools.jackson.databind.ObjectMapper mapper)
      Installs only the MongoJackModule, without JavaTimeModule or other settings.
      Parameters:
      mapper -
      Returns:
    • addMongojackModuleOnly

      public static tools.jackson.databind.ObjectMapper addMongojackModuleOnly(tools.jackson.databind.ObjectMapper mapper, MongoJackModuleConfiguration moduleConfiguration)
      Installs only the MongoJackModule, without JavaTimeModule or other settings.
      Parameters:
      mapper -
      Returns: