|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.borg.model.Model
public abstract class Model
base class for data models. A Model provides access to a data store to the outside world. Clients of the model can register as Listeners to be provided with feedback any time the model changes.
| Nested Class Summary | |
|---|---|
static class |
Model.ChangeEvent
The Class ChangeEvent. |
static interface |
Model.Listener
Listener for a Model. |
| Constructor Summary | |
|---|---|
Model()
Instantiates a new model. |
|
| Method Summary | |
|---|---|
void |
addListener(Model.Listener listener)
Adds a listener. |
abstract void |
export(Writer fw)
Export the models data to XML |
static List<Model> |
getExistingModels()
get a list of all instantiated models |
abstract String |
getExportName()
get the root XML element name for this model's XML representation |
abstract String |
getInfo()
return user readable information about the model |
abstract void |
importXml(InputStream is)
Import model data from XML |
protected void |
refreshListeners()
send an update message to all listeners with no change event |
protected void |
refreshListeners(Model.ChangeEvent event)
send an update message to all listeners with a change event. |
void |
remove()
Removes the listeners. |
void |
removeListener(Model.Listener listener)
Removes a listener. |
protected void |
removeListeners()
notify all listeners that the model is being destroyed |
protected void |
sync()
sync the model with the underlying DB for DBs that can be changed without going through Borg (i.e. |
static void |
syncModels()
sync all models |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Model()
| Method Detail |
|---|
public static List<Model> getExistingModels()
public static void syncModels()
protected void sync()
public void addListener(Model.Listener listener)
listener - the listenerprotected void refreshListeners()
protected void refreshListeners(Model.ChangeEvent event)
public void remove()
public void removeListener(Model.Listener listener)
listener - the listenerprotected void removeListeners()
public abstract void export(Writer fw)
throws Exception
fw - - writer to write the XML to
Exception
public abstract void importXml(InputStream is)
throws Exception
is - input stream containing XML
Exceptionpublic abstract String getExportName()
public abstract String getInfo()
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||