|
eXchaNGeR | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The representation of a document for the xngr application. This implementation of this interface gives the service a reference to a document within the system and allows the service to save and get document specific parameters like the URL and the root element. It also allows for a listener to be added to listen for changes in the document.
Method Summary | |
void |
addListener(XDocumentListener listener)
Adds a document listener to the document. |
void |
consistent()
Checks to find out if this version of the document is consistent with the one saved on disk. |
void |
delete()
Deletes the document from the eXchaNGeR application and informs the listeners about this. |
XElement |
getElement(String xpath)
Gets an element from this document for the specified XPath expression. |
XElement[] |
getElements(String xpath)
Gets a list of elements from this document for the specified XPath expression. |
String |
getName()
Returns the name for this document. |
XElement |
getRoot()
Returns the root element for this document. |
URL |
getURL()
Returns the URL for this document. |
void |
load()
Loads the document and informs the listeners about a potential complete update. |
void |
removeListener(XDocumentListener listener)
Removes a document listener from the document. |
void |
save()
Saves the document and informs the listeners about a potential complete update. |
void |
update(XElement element)
Lets listeners know that the document has been updated. |
Method Detail |
public XElement getElement(String xpath)
xpath
- the XPath expression to the element.public XElement[] getElements(String xpath)
xpath
- the XPath expression to the element(s).public URL getURL()
public String getName()
public XElement getRoot()
public void save() throws IOException
IOException
- if the document cannot be saved.public void load() throws IOException, org.xml.sax.SAXParseException
IOException
- if the document cannot be found.org.xml.sax.SAXParseException
- if the information
in the document cannot be parsed.public void delete()
public void update(XElement element)
element
- the root element for the changes in the elements.public void consistent()
When the document has been changed or deleted by an external
process the user is informed and forced to make a decision on
wether to go on with the saved 'external' version or the
current 'internal' version. This results in a
documentUpdated()
or documentDeleted()
event being fired.
public void addListener(XDocumentListener listener)
listener
- the listener for changes in the document.public void removeListener(XDocumentListener listener)
listener
- the listener for changes in the document.
|
eXchaNGeR | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |