org.fuin.serialver4j.base
Class ClassesHistory

java.lang.Object
  extended by org.fuin.serialver4j.base.ClassesHistory
All Implemented Interfaces:
Serializable

public final class ClassesHistory
extends Object
implements Serializable

History of classes.

See Also:
Serialized Form

Constructor Summary
ClassesHistory(ConverterFactory converterFactory)
          Constructor with converter factory.
ClassesHistory(String versionTag, ConverterFactory converterFactory)
          Constructor with tag and converter factory.
 
Method Summary
 void add(VersionedClass versionedClass)
          Adds a class to the history.
 Converter<? extends Object,? extends Object> findConverter(Class<?> oldClass)
          Tries to find a converter for a given class.
 VersionedClass findVersionedClass(String name)
          Tries to finds a class by it's name.
 ConverterFactory getConverterFactory()
          Returns the converter factory.
 String getVersionTag()
          Returns the name of the version tag.
 void init(ConverterFactory converterFactory)
          Initialize the instance after it has been deserialized.
 void remove(VersionedClass versionedClass)
          Removes a class from the history.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassesHistory

public ClassesHistory(ConverterFactory converterFactory)
Constructor with converter factory. The version tag is set to "version".

Parameters:
converterFactory - Converter factory to use.

ClassesHistory

public ClassesHistory(String versionTag,
                      ConverterFactory converterFactory)
Constructor with tag and converter factory.

Parameters:
versionTag - Tag name of the version tag.
converterFactory - Converter factory to use.
Method Detail

init

public final void init(ConverterFactory converterFactory)
Initialize the instance after it has been deserialized. Transient fields are set properly after calling this method.

Parameters:
converterFactory - Factory to use.

getConverterFactory

public final ConverterFactory getConverterFactory()
Returns the converter factory.

Returns:
Converter factory.

add

public final void add(VersionedClass versionedClass)
Adds a class to the history.

Parameters:
versionedClass - Class to add.

remove

public final void remove(VersionedClass versionedClass)
Removes a class from the history.

Parameters:
versionedClass - Class to remove.

findVersionedClass

public final VersionedClass findVersionedClass(String name)
Tries to finds a class by it's name.

Parameters:
name - Full qualified name of the class.
Returns:
Version information for the class or null if no information exists.

findConverter

public final Converter<? extends Object,? extends Object> findConverter(Class<?> oldClass)
Tries to find a converter for a given class.

Parameters:
oldClass - Possibly old class.
Returns:
Converter if one exists, else null.

getVersionTag

public final String getVersionTag()
Returns the name of the version tag.

Returns:
Name of the version tag.


Copyright © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.