Class MongoJackModule

  • All Implemented Interfaces:
    com.fasterxml.jackson.core.Versioned

    public class MongoJackModule
    extends com.fasterxml.jackson.databind.Module
    The ObjectID serialising module
    Since:
    1.0
    Author:
    James Roper
    • Field Detail

      • DEFAULT_MODULE_INSTANCE

        public static final com.fasterxml.jackson.databind.Module DEFAULT_MODULE_INSTANCE
      • DEFAULT_JAVA_TIME_MODULE

        public static final com.fasterxml.jackson.databind.Module DEFAULT_JAVA_TIME_MODULE
    • Constructor Detail

      • MongoJackModule

        public MongoJackModule()
    • Method Detail

      • configure

        public static com.fasterxml.jackson.databind.ObjectMapper configure​(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
        Configure the given object mapper to be used with MongoJack. Please call this method rather than calling objectMapper.with(MongoJacksonMapperModule.INSTANCE), because Jacksons module system doesn't allow MongoJack to do all the configuration it needs to do. This method will do that configuration though.
        Parameters:
        objectMapper - The object mapper to configure
        Returns:
        This object mapper (for chaining)
      • configure

        public static com.fasterxml.jackson.databind.ObjectMapper configure​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                                                            MongoJackModuleConfiguration moduleConfiguration)
        Configure the given object mapper to be used with MongoJack. Please call this method rather than calling objectMapper.with(MongoJacksonMapperModule.INSTANCE), because Jacksons module system doesn't allow MongoJack to do all the configuration it needs to do. This method will do that configuration though.
        Parameters:
        objectMapper - The object mapper to configure
        moduleConfiguration - The configuration of the module
        Returns:
        This object mapper (for chaining)
      • getModuleName

        public String getModuleName()
        Specified by:
        getModuleName in class com.fasterxml.jackson.databind.Module
      • version

        public com.fasterxml.jackson.core.Version version()
        Specified by:
        version in interface com.fasterxml.jackson.core.Versioned
        Specified by:
        version in class com.fasterxml.jackson.databind.Module
      • setupModule

        public void setupModule​(com.fasterxml.jackson.databind.Module.SetupContext context)
        Specified by:
        setupModule in class com.fasterxml.jackson.databind.Module