Package net.solarnetwork.codec
Class ObjectMapperFactoryBean
java.lang.Object
net.solarnetwork.service.support.SimpleObjectMapperService
net.solarnetwork.codec.ObjectMapperModuleSupport
net.solarnetwork.codec.ObjectMapperFactoryBean
- All Implemented Interfaces:
ObjectMapperService,org.springframework.beans.factory.FactoryBean<com.fasterxml.jackson.databind.ObjectMapper>
public class ObjectMapperFactoryBean
extends ObjectMapperModuleSupport
implements org.springframework.beans.factory.FactoryBean<com.fasterxml.jackson.databind.ObjectMapper>
Factory for
ObjectMapper that allows configuring an application-wide
ObjectMapper.
This factory will generate a Module and register that with the
returned ObjectMapper.
The configurable properties of this class are:
- moduleName
- A
Modulename to use. - moduleVersion
- A
Versionto use for the module. - serializers
- A list of serializers to register with the module.
- deserializers
- A list of deserializers to register with the module. Note that these must
be subclasses of
StdDeserializer. - mapper
- The
ObjectMapperto configure. - serializationInclusion
- A serialization inclusion setting to configure.
- featuresToEnable
- A list of
SerializationFeatureorDeserializationFeatureflags to enable. - featuresToDisable
- A list of
SerializationFeatureorDeserializationFeatureflags to disable.
- Version:
- 1.5
- Author:
- matt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a list ofSerializationFeatureorDeserializationFeatureflags to disable.Get a list ofSerializationFeatureorDeserializationFeatureflags to enable.com.fasterxml.jackson.databind.ObjectMapperClass<?>com.fasterxml.jackson.annotation.JsonInclude.IncludeGet the serialization inclusion setting.booleanvoidsetFeaturesToDisable(List<Object> featuresToDisable) Set a list ofSerializationFeatureorDeserializationFeatureflags to disable.voidsetFeaturesToEnable(List<Object> featuresToEnable) Set a list ofSerializationFeatureorDeserializationFeatureflags to enable.voidsetSerializationInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include serializationInclusion) Set the serialization inclusion to use.Methods inherited from class net.solarnetwork.codec.ObjectMapperModuleSupport
getDeserializers, getKeyDeserializers, getKeySerializers, getModuleName, getModules, getModuleVersion, getSerializers, registerDeserializer, registerKeySerializer, setDeserializers, setKeyDeserializers, setKeySerializers, setModuleName, setModules, setModuleVersion, setSerializers, setVersionMethods inherited from class net.solarnetwork.service.support.SimpleObjectMapperService
getObjectMapper, setJsonFactory, setObjectMapper
-
Constructor Details
-
ObjectMapperFactoryBean
public ObjectMapperFactoryBean()
-
-
Method Details
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<com.fasterxml.jackson.databind.ObjectMapper>- Throws:
Exception
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<com.fasterxml.jackson.databind.ObjectMapper>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<com.fasterxml.jackson.databind.ObjectMapper>
-
getSerializationInclusion
public com.fasterxml.jackson.annotation.JsonInclude.Include getSerializationInclusion()Get the serialization inclusion setting.- Returns:
- the serialization inclusion
- Since:
- 1.2
-
setSerializationInclusion
public void setSerializationInclusion(com.fasterxml.jackson.annotation.JsonInclude.Include serializationInclusion) Set the serialization inclusion to use.- Parameters:
serializationInclusion- the inclusion setting- Since:
- 1.2
-
getFeaturesToEnable
Get a list ofSerializationFeatureorDeserializationFeatureflags to enable.- Returns:
- list of features to enable
- Since:
- 1.2
-
setFeaturesToEnable
Set a list ofSerializationFeatureorDeserializationFeatureflags to enable.- Parameters:
featuresToEnable- the list of features to enable- Since:
- 1.2
-
getFeaturesToDisable
Get a list ofSerializationFeatureorDeserializationFeatureflags to disable.- Returns:
- the list of features to disable
- Since:
- 1.2
-
setFeaturesToDisable
Set a list ofSerializationFeatureorDeserializationFeatureflags to disable.- Parameters:
featuresToDisable- the list of features to disable- Since:
- 1.2
-