org.codehaus.jackson.map.module
Class SimpleModule

java.lang.Object
  extended by org.codehaus.jackson.map.Module
      extended by org.codehaus.jackson.map.module.SimpleModule
All Implemented Interfaces:
Versioned

public class SimpleModule
extends Module

Simple Module implementation that allows registration of serializers and deserializers, and bean serializer and deserializer modifiers.

Since:
1.7

Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.jackson.map.Module
Module.SetupContext
 
Field Summary
protected  SimpleDeserializers _deserializers
           
protected  String _name
           
protected  SimpleSerializers _serializers
           
protected  Version _version
           
 
Constructor Summary
SimpleModule(String name, Version version)
           
 
Method Summary
<T> SimpleModule
addDeserializer(Class<T> type, JsonDeserializer<? extends T> deser)
           
<T> SimpleModule
addSerializer(Class<? extends T> type, JsonSerializer<T> ser)
           
 SimpleModule addSerializer(JsonSerializer<?> ser)
           
 String getModuleName()
          Method that returns identifier for module; this can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them.
 void setupModule(Module.SetupContext context)
          Method called by ObjectMapper when module is registered.
 Version version()
          Method that returns version of this module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

protected final String _name

_version

protected final Version _version

_serializers

protected SimpleSerializers _serializers

_deserializers

protected SimpleDeserializers _deserializers
Constructor Detail

SimpleModule

public SimpleModule(String name,
                    Version version)
Method Detail

addSerializer

public SimpleModule addSerializer(JsonSerializer<?> ser)

addSerializer

public <T> SimpleModule addSerializer(Class<? extends T> type,
                                      JsonSerializer<T> ser)

addDeserializer

public <T> SimpleModule addDeserializer(Class<T> type,
                                        JsonDeserializer<? extends T> deser)

getModuleName

public String getModuleName()
Description copied from class: Module
Method that returns identifier for module; this can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them.

Specified by:
getModuleName in class Module

setupModule

public void setupModule(Module.SetupContext context)
Description copied from class: Module
Method called by ObjectMapper when module is registered. It is called to let module register functionality it provides, using callback methods passed-in context object exposes.

Specified by:
setupModule in class Module

version

public Version version()
Description copied from class: Module
Method that returns version of this module. Can be used by Jackson for informational purposes.

Specified by:
version in interface Versioned
Specified by:
version in class Module