Package org.mongojack

Class 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 Detail

      • configureObjectMapper

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

        public static com.fasterxml.jackson.databind.ObjectMapper configureObjectMapper​(com.fasterxml.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 com.fasterxml.jackson.databind.ObjectMapper addMongojackModuleOnly​(com.fasterxml.jackson.databind.ObjectMapper mapper)
        Installs only the MongoJackModule, without JavaTimeModule or other settings.
        Parameters:
        mapper -
        Returns:
      • addMongojackModuleOnly

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