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.
SerDeserializers(SerDeserializerProvider... providers)
          Creates an instance using additional providers.
 
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.
 SerDeserializers registerProvider(SerDeserializerProvider provider)
          Adds the deserializer provider to be used.
 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.


SerDeserializers

public SerDeserializers(SerDeserializerProvider... providers)
Creates an instance using additional providers.

Parameters:
providers - the providers to use
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

registerProvider

public SerDeserializers registerProvider(SerDeserializerProvider provider)
Adds the deserializer provider to be used.

Parameters:
provider - the deserializer provider, not null
Returns:
this, for chaining, 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–2017 Joda.org. All rights reserved.