Package org.mongojack.internal
Class MongoJackModule
- java.lang.Object
-
- com.fasterxml.jackson.databind.Module
-
- org.mongojack.internal.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 Summary
Fields Modifier and Type Field Description static MongoJackModuleConfiguration
DEFAULT_CONFIGURATION
static com.fasterxml.jackson.databind.Module
DEFAULT_JAVA_TIME_MODULE
static com.fasterxml.jackson.databind.Module
DEFAULT_MODULE_INSTANCE
-
Constructor Summary
Constructors Constructor Description MongoJackModule()
MongoJackModule(MongoJackModuleConfiguration moduleConfiguration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.fasterxml.jackson.databind.ObjectMapper
configure(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Configure the given object mapper to be used with MongoJack.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.String
getModuleName()
void
setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
com.fasterxml.jackson.core.Version
version()
-
-
-
Field Detail
-
DEFAULT_CONFIGURATION
public static final MongoJackModuleConfiguration DEFAULT_CONFIGURATION
-
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()
-
MongoJackModule
public MongoJackModule(MongoJackModuleConfiguration moduleConfiguration)
-
-
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 configuremoduleConfiguration
- The configuration of the module- Returns:
- This object mapper (for chaining)
-
getModuleName
public String getModuleName()
- Specified by:
getModuleName
in classcom.fasterxml.jackson.databind.Module
-
version
public com.fasterxml.jackson.core.Version version()
- Specified by:
version
in interfacecom.fasterxml.jackson.core.Versioned
- Specified by:
version
in classcom.fasterxml.jackson.databind.Module
-
setupModule
public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
- Specified by:
setupModule
in classcom.fasterxml.jackson.databind.Module
-
-