gate.util.persistence
Class PersistenceManager
java.lang.Object
|
+--gate.util.persistence.PersistenceManager
- public class PersistenceManager
- extends Object
This class provides utility methods for saving resources through
serialisation via static methods.
PersistenceManager
public PersistenceManager()
saveObjectToFile
public static void saveObjectToFile(Object obj,
File file)
throws PersistenceException,
IOException
loadObjectFromFile
public static Object loadObjectFromFile(File file)
throws PersistenceException,
IOException,
ResourceInstantiationException
registerPersitentEquivalent
public static Class registerPersitentEquivalent(Class transientType,
Class persistentType)
throws PersistenceException
- Sets the persistent equivalent type to be used to (re)store a given type
of transient objects.
- Parameters:
transientType
- the type that will be replaced during serialisation
operationspersistentType
- the type used to replace objects of transient type
when serialising; this type needs to extend Persistence
.- Returns:
- the persitent type that was used before this mapping if such
existed.