|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IPersistable
Base interface for objects that can be made persistent. Every object that complies to this interface must provide either a constructor that takes an input stream as only parameter or an empty constructor so it can be loaded from the persistence store. However this is not required for objects that are created by the application and initialized afterwards.
Input
,
IPersistenceStore.load(String)
Field Summary | |
---|---|
static String |
TRANSIENT_PREFIX
Prefix for attribute names that should not be made persistent. |
Method Summary | |
---|---|
void |
deserialize(Input input)
Load the object from the passed input stream. |
long |
getLastModified()
Returns the timestamp when the object was last modified. |
String |
getName()
Returns the name of the persistent object. |
String |
getPath()
Returns the path of the persistent object. |
IPersistenceStore |
getStore()
Returns the persistence store this object is stored in |
String |
getType()
Returns the type of the persistent object. |
boolean |
isPersistent()
Returns true if the object is persistent,
false otherwise. |
void |
serialize(Output output)
Write the object to the passed output stream. |
void |
setName(String name)
Set the name of the persistent object. |
void |
setPath(String path)
Set the path of the persistent object. |
void |
setPersistent(boolean persistent)
Set the persistent flag of the object. |
void |
setStore(IPersistenceStore store)
Store a reference to the persistence store in the object. |
Field Detail |
---|
static final String TRANSIENT_PREFIX
Method Detail |
---|
boolean isPersistent()
true
if the object is persistent,
false
otherwise.
true
if object is persistent, false
otherwisevoid setPersistent(boolean persistent)
persistent
- true
if object is persistent, false
otherwiseString getName()
void setName(String name)
name
- New object nameString getType()
String getPath()
void setPath(String path)
path
- New persisted object pathlong getLastModified()
IPersistenceStore getStore()
void setStore(IPersistenceStore store)
store
- Store the object is saved invoid serialize(Output output) throws IOException
output
- Output stream to write to
IOException
- Any I/O exceptionvoid deserialize(Input input) throws IOException
input
- Input stream to load from
IOException
- Any I/O exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |