|
XNGR XML Browser | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The representation of a document for the xngr application. The 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. |
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 as set by the user. |
XElement |
getRoot()
Returns the root element for this document. |
URL |
getURL()
Returns the URL for this document. |
boolean |
isUpdated()
Find out wether the document in memory is different to the document on disk. |
void |
load()
Loads the document from disk and informs the listeners about the update. |
void |
removeListener(XDocumentListener listener)
Removes a document listener from the document. |
void |
save()
Saves the document to disk and informs the listeners about the update. |
| Method Detail |
public XElement getElement(String xpath)
throws Exception
xpath - the XPath expression to the element.
Exception - throws an Exception when the XML information in the
document could not been parser, this can be an IOException
or SAXParseException.
public XElement[] getElements(String xpath)
throws Exception
xpath - the XPath expression to the element(s).
Exception - throws an Exception when the XML information in the
document could not been parser, this can be an IOException
or SAXParseException.
public XElement getRoot()
throws Exception
Exception - throws an Exception when the XML information in the
document could not been parser, this can be an IOException
or SAXParseException.public URL getURL()
public String getName()
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 boolean isUpdated()
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.
|
XNGR XML Browser | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||