net.refractions.udig.project
Class IPersister<T>

java.lang.Object
  extended by net.refractions.udig.project.IPersister<T>

public abstract class IPersister<T>
extends java.lang.Object

Allows blackboard to persist objects on the blackboard.

Since:
1.0.0
Author:
Jesse

Field Summary
static java.lang.String XPID
          Extension point id.
 
Constructor Summary
IPersister()
           
 
Method Summary
 IExtension getExtension()
           
abstract  java.lang.Class<T> getPersistee()
          Returns the class of the object being persisted.
abstract  T load(IMemento memento)
          Loads an object from a memento containing the objects internaObjectl state.
abstract  void save(T object, IMemento memento)
          Saves the internal state of an object instance to a memento.
 void setExtension(IExtension extension)
          Sets the extension that persister originated from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XPID

public static final java.lang.String XPID
Extension point id. *

See Also:
Constant Field Values
Constructor Detail

IPersister

public IPersister()
Method Detail

setExtension

public void setExtension(IExtension extension)
Sets the extension that persister originated from. This method should not be called by client code.

Parameters:
extension - The extension in which the persister was instantiated.

getExtension

public IExtension getExtension()
Returns:
the extension the persister originated from.

getPersistee

public abstract java.lang.Class<T> getPersistee()
Returns the class of the object being persisted. How this class relates to the class of objects being persisted (via inheritance) is up to the client of the persister.

Returns:
The type of the object being persisted (the persistee).

load

public abstract T load(IMemento memento)
Loads an object from a memento containing the objects internaObjectl state.

Parameters:
memento - A memento.
Returns:
The object with state restored.

save

public abstract void save(T object,
                          IMemento memento)
Saves the internal state of an object instance to a memento.

Parameters:
object - The object being persisted (the persistee).
memento - The memento in which to save object state.