org.joda.beans.ser
Class SerDeserializers

java.lang.Object
  extended by org.joda.beans.ser.SerDeserializers

public final class SerDeserializers
extends Object

Manages a map of deserializers that assist with data migration.

Deserializers handle situations where the data being read does not match the bean in the classpath. See also RenameHandler.

Normally, it makes sense to customize the shared singleton instance, because the classpath is static and fixed and the transformations are common.

Implementations must be thread-safe singletons.


Field Summary
static SerDeserializers INSTANCE
          Shared global instance which can be mutated.
 
Constructor Summary
SerDeserializers()
          Creates an instance.
 
Method Summary
 SerDeserializer findDeserializer(Class<?> type)
          Finds the deserializer for the specified type.
 ConcurrentMap<Class<?>,SerDeserializer> getDeserializers()
          Gets the map of deserializers which can be modified.
 SerDeserializers register(Class<?> type, SerDeserializer deserializer)
          Adds the deserializer to be used for the specified type.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final SerDeserializers INSTANCE
Shared global instance which can be mutated.

Constructor Detail

SerDeserializers

public SerDeserializers()
Creates an instance.

Method Detail

register

public SerDeserializers register(Class<?> type,
                                 SerDeserializer deserializer)
Adds the deserializer to be used for the specified type.

Parameters:
type - the type, not null
deserializer - the deserializer, not null
Returns:
this, for chaining, not null

getDeserializers

public ConcurrentMap<Class<?>,SerDeserializer> getDeserializers()
Gets the map of deserializers which can be modified.

Returns:
the map of deserializers, not null

findDeserializer

public SerDeserializer findDeserializer(Class<?> type)
Finds the deserializer for the specified type.

The DefaultDeserializer is used if one has not been registered.

Parameters:
type - the type, not null
Returns:
the deserializer, not null

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007–2014 Joda.org. All rights reserved.