Public Methods | |
Document (Element rootElement, DocType docType) | |
Document (Element rootElement) | |
Document (List newContent, DocType docType) | |
Document (List content) | |
boolean | hasRootElement () |
Element | getRootElement () |
Document | setRootElement (Element rootElement) |
Element | detachRootElement () |
DocType | getDocType () |
Document | setDocType (DocType docType) |
Document | addContent (ProcessingInstruction pi) |
Document | addContent (Comment comment) |
List | getContent () |
Document | setContent (List newContent) |
boolean | removeContent (ProcessingInstruction pi) |
boolean | removeContent (Comment comment) |
String | toString () |
final boolean | equals (Object ob) |
final int | hashCode () |
Object | clone () |
Protected Methods | |
Document () | |
Protected Attributes | |
ContentList | content = new ContentList(this) |
DocType | docType |
Document
defines behavior for an XML Document, modeled in Java. Methods allow access to the root element as well as processing instructions and other document-level information.
|
Default, no-args constructor for implementations to use if needed. |
|
This will create a new |
|
This will create a new
|
|
This will create a new
|
|
This will create a new
|
|
This will add a comment to the
|
|
Adds the specified PI to the document.
|
|
This will return a deep clone of this
|
|
Detach the root
|
|
This tests for equality of this
|
|
This will return all content for the
|
|
This will return the
|
|
This will return the root
|
|
This returns the hash code for this
|
|
This will return
|
|
This removes the specified
|
|
This removes the specified
|
|
This sets the content of the
When all objects in the supplied List are valid and before the new content is added, all objects in the old content will have their parentage set to null (no parent) and the old content list will be cleared. This has the effect that any active list (previously obtained with a call to getContent) will also change to reflect the new content. In addition, all objects in the supplied List will have their parentage set to this document, but the List itself will not be "live" and further removals and additions will have no effect on this document content. If the user wants to continue working with a "live" list, then a call to setContent should be followed by a call to getContent to obtain a "live" version of the content.
Passing a null or empty List clears the existing content.
In event of an exception the original content will be unchanged and the objects in the supplied content will be unaltered.
|
|
This will set the
|
|
This sets the root
|
|
This returns a
|
|
This |
|
The |