Public Member Functions | |
Document () | |
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 () |
List | getContent (Filter filter) |
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 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.
Jason Hunter
Jools Enticknap
Bradley S. Huffman
|
Creates a new empty document. A document must have a root element, so this document will not be well-formed and accessor methods will throw an IllegalStateException if this document is accessed before a root element is added. This method is most useful for build tools. |
|
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
|
|
Return a filtered view of this Sequential traversal through the List is best done with a Iterator since the underlying implement of List.size() may require walking the entire list.
|
|
This will return all content for the Sequential traversal through the List is best done with a Iterator since the underlying implement of List.size() may require walking the entire list.
|
|
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 legal 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 |