|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.embl.ebi.escience.scufl.view.XScuflView
public class XScuflView
Represents a ScuflModel instance as an XScufl document.
The view registers with the model to always provide updated XML representations.
Note that when you are finished using the view, you have to manually remove the listener from the model as:
XScuflView view = new XScuflView(model); .. model.removeListener(view);If you don't do this, the NotifyThread will be kept alive by the XScuflView, and the XScuflView by the list of listeners in NotifyThread. Indirectly that would mean even the ScuflModel is kept alive forever.
Use the static methods getDocument(ScuflModel model)
and getXMLText(ScuflModel model) to avoid constructing
the view and having to remember to remove the listener from the
ScuflModel.
| Constructor Summary | |
|---|---|
XScuflView(ScuflModel model)
Construct the view and bind to the given model. |
|
| Method Summary | |
|---|---|
org.jdom.Document |
getDocument()
Get the XML Document from this view. |
static org.jdom.Document |
getDocument(ScuflModel model)
Get the XML Document for the model. |
java.lang.String |
getXMLText()
Get the XML String from this view |
static java.lang.String |
getXMLText(ScuflModel model)
Get the XML representation as String for this model. |
void |
receiveModelEvent(ScuflModelEvent event)
Invalidate cache on changed model (but don't recalculate the XML now) |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XScuflView(ScuflModel model)
| Method Detail |
|---|
public org.jdom.Document getDocument()
This is probably preferable over getXMLText() if you are passing on the XML to another method expecting either Document or String.
public static org.jdom.Document getDocument(ScuflModel model)
Use this static version of getXMLText() if you are only getting the XML once, and don't expect the model to change.
This is probably preferable over getXMLText(model) if you are passing on the XML to another method expecting either Document or String.
public java.lang.String getXMLText()
public static java.lang.String getXMLText(ScuflModel model)
public void receiveModelEvent(ScuflModelEvent event)
receiveModelEvent in interface ScuflModelEventListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||