Package net.solarnetwork.codec
Class ObjectMapperModuleSupport
java.lang.Object
net.solarnetwork.service.support.SimpleObjectMapperService
net.solarnetwork.codec.ObjectMapperModuleSupport
- All Implemented Interfaces:
ObjectMapperService
- Direct Known Subclasses:
ObjectMapperFactoryBean,ObjectMapperModuleContributor
Helper class for
ObjectMapper configuration.- Version:
- 1.1
- Author:
- matt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<com.fasterxml.jackson.databind.JsonDeserializer<?>>Get the configured list ofKeyDeserializerobjects to register.List<com.fasterxml.jackson.databind.JsonSerializer<?>>Get the module name.List<com.fasterxml.jackson.databind.Module>Get the list of modules.com.fasterxml.jackson.core.VersionGet the module version.List<com.fasterxml.jackson.databind.JsonSerializer<?>>Get the serializers.protected voidregisterDeserializer(com.fasterxml.jackson.databind.module.SimpleModule module, com.fasterxml.jackson.databind.JsonDeserializer deserializer) Helper method for registeringJsonDeserializerinstances of unknown types at runtime, ignoring compiler warnings.protected voidregisterKeySerializer(com.fasterxml.jackson.databind.module.SimpleModule module, com.fasterxml.jackson.databind.JsonSerializer serializer) Helper method for registering keyJsonSerializerinstances of unknown types at runtime, ignoring compiler warnings.voidsetDeserializers(List<com.fasterxml.jackson.databind.JsonDeserializer<?>> deserializers) Set a list ofJsonDeserializerobjects to configure on the module.voidsetKeyDeserializers(List<TypedKeyDeserializer> keyDeserializers) Set a list ofTypedKeyDeserializerobjects.voidsetKeySerializers(List<com.fasterxml.jackson.databind.JsonSerializer<?>> keySerializers) Set a list of key serializers to register.voidsetModuleName(String moduleName) Set the module name.voidsetModules(List<com.fasterxml.jackson.databind.Module> modules) Set a list of modules to register.voidsetModuleVersion(com.fasterxml.jackson.core.Version moduleVersion) Set the module version.voidsetSerializers(List<com.fasterxml.jackson.databind.JsonSerializer<?>> serializers) Set a list ofJsonSerializerobjects to configure on the module.voidsetVersion(String versionString) Set the module version as a period-delimited version string, e.g.Methods inherited from class net.solarnetwork.service.support.SimpleObjectMapperService
getObjectMapper, setJsonFactory, setObjectMapper
-
Constructor Details
-
ObjectMapperModuleSupport
public ObjectMapperModuleSupport()
-
-
Method Details
-
registerDeserializer
protected void registerDeserializer(com.fasterxml.jackson.databind.module.SimpleModule module, com.fasterxml.jackson.databind.JsonDeserializer deserializer) Helper method for registeringJsonDeserializerinstances of unknown types at runtime, ignoring compiler warnings.- Parameters:
module- The module to register with.deserializer- AJsonDeserializerinstance.
-
registerKeySerializer
protected void registerKeySerializer(com.fasterxml.jackson.databind.module.SimpleModule module, com.fasterxml.jackson.databind.JsonSerializer serializer) Helper method for registering keyJsonSerializerinstances of unknown types at runtime, ignoring compiler warnings.- Parameters:
module- The module to register with.serializer- AJsonSerializerinstance.
-
getModuleName
Get the module name.- Returns:
- the name
-
setModuleName
Set the module name.- Parameters:
moduleName- The module name to set.
-
getModuleVersion
public com.fasterxml.jackson.core.Version getModuleVersion()Get the module version.- Returns:
- the version
-
setModuleVersion
public void setModuleVersion(com.fasterxml.jackson.core.Version moduleVersion) Set the module version.- Parameters:
moduleVersion- The version to set.- See Also:
-
setVersion
Set the module version as a period-delimited version string, e.g.1.0.0.- Parameters:
versionString- The version string to set.- See Also:
-
getSerializers
Get the serializers.- Returns:
- the serializers
-
setSerializers
Set a list ofJsonSerializerobjects to configure on the module.- Parameters:
serializers- the serializers
-
getDeserializers
-
setDeserializers
public void setDeserializers(List<com.fasterxml.jackson.databind.JsonDeserializer<?>> deserializers) Set a list ofJsonDeserializerobjects to configure on the module.- Parameters:
deserializers- the deserializers
-
getKeyDeserializers
Get the configured list ofKeyDeserializerobjects to register.- Returns:
- List of key deserializers.
-
setKeyDeserializers
Set a list ofTypedKeyDeserializerobjects.- Parameters:
keyDeserializers- The key deserializers.
-
getKeySerializers
-
setKeySerializers
public void setKeySerializers(List<com.fasterxml.jackson.databind.JsonSerializer<?>> keySerializers) Set a list of key serializers to register.- Parameters:
keySerializers- The key serializers to register.
-
getModules
Get the list of modules.- Returns:
- the modules
- Since:
- 1.1
-
setModules
Set a list of modules to register.- Parameters:
modules- the modules to set- Since:
- 1.1
-