DocType and other document-level information.
| Modifier and Type | Field and Description |
|---|---|
| protected String | baseURI
See http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html#baseURIs-Considerations |
| pack-priv ContentList | content
This document's content including comments, PIs, a possible DocType, and a root element. |
| private static final String | |
| private HashMap |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Document | Returns: the document on which the method was calledchild to append to end of content list child)Appends the child to the end of the content list. |
| public Document | Returns: the document on which the method was calledcollection to append c)Appends all children in the given collection to the end of the content list. |
| public Document | Returns: the parent on which the method was calledlocation for adding the collection index, Content child to insert child)Inserts the child into the content list at the given index. |
| public Document | Returns: the parent on which the method was calledlocation for adding the collection index, Collection<E> collection to insert c)Inserts the content in a collection into the content list at the given index. |
| public Object | Returns: Object clone of this DocumentOverrides java. Implements org. Document.
|
| public List | cloneContent()
Implements org. |
| public Element | |
| public final boolean | Returns: boolean whether the Document is
equal to the supplied ObjectObject to compare toOverrides java. Document to the supplied
Object.
|
| public final String | Returns: the base URI of this documentReturns the URI from which this document was loaded, or null if this is not known. |
| public Content | getContent(int
location of desired child index)Implements org. |
| public List | Returns: List - all Document contentImplements org. Document.
|
| public List | Returns: List - filtered Document contentFilter to applyImplements org. Document's content.
|
| public int | getContentSize()
Implements org. |
| public Iterator | Returns: an iterator to walk descendantsImplements org. |
| public Iterator | Returns: an iterator to walk descendants within a filterfilter to select which descendants to see filter)Implements org. |
| public DocType | Returns: DocType - the DOCTYPE declaration.This will return the |
| public Document | getDocument()
Implements org. |
| public Parent | getParent()
Implements org. |
| public Object | Returns: the object associated with the given idthe id of the stored object to return id)Returns the object associated with this document under the given "id" string, or null if there is no binding or if the binding explicitly stored a null value. |
| public Element | Returns: Element - the document's root elementThis will return the root |
| public final int | Returns: int hash codeOverrides java. Document.
|
| public boolean | Returns: true if this document has a root element,
false otherwise.This will return |
| public int | indexOf(Content
child to search for child)Implements org. |
| public List | Returns: list of the old children detached from this parentImplements org. |
| public List | Returns: list of the old children detached from this parentfilter to select which content to remove filter)Implements org. |
| public boolean | removeContent(Content
child to remove child)Implements org. |
| public Content | removeContent(int
index of child to remove index)Implements org. |
| public final void | setBaseURI(String
the base URI of this document uri)Sets the effective URI from which this document was loaded, and against which relative URLs in this document will be resolved. |
| public Document | Returns: this document modifiedList of content to setThis sets the content of the |
| public Document | |
| public Document | Returns: object on which the method was invoked- index of child to replace. index, Collection<E> - collection of content to add. collection)Replace the child at the given index whith the supplied collection. |
| public Document | Returns: the parent on which the method was callednew content to replace existing content child)Set this document's content to be the supplied child. |
| public Document | Returns: object on which the method was invokedDocType declaration.This will set the |
| public void | setProperty(String
the id of the stored object id, Object the object to store value)Assigns an arbitrary object to be associated with this document under the given "id" string. |
| public Document | Returns: Document - modified Document.Element to be new root.This sets the root |
| public String | Returns: String - information about the
DocumentOverrides java. String representation of the
Document, suitable for debugging.
|
| baseURI | back to summary |
|---|---|
| protected String baseURI See http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html#baseURIs-Considerations | |
| content | back to summary |
|---|---|
| pack-priv ContentList content This document's content including comments, PIs, a possible DocType, and a root element. Subclassers have to track content using their own mechanism. | |
| CVS_ID | back to summary |
|---|---|
| private static final String CVS_ID | |
| propertyMap | back to summary |
|---|---|
| private HashMap<K, V> propertyMap | |
| Document | back to summary |
|---|---|
| public Document() 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. | |
| Document | back to summary |
|---|---|
| public Document(Element rootElement, DocType docType, String baseURI) This will create a new
| |
| Document | back to summary |
|---|---|
| public Document(Element rootElement, DocType docType) This will create a new
| |
| Document | back to summary |
|---|---|
| public Document(Element rootElement) This will create a new
| |
| Document | back to summary |
|---|---|
| public Document(List<E> content) This will create a new
| |
| addContent | back to summary |
|---|---|
| public Document addContent(Content child) Appends the child to the end of the content list.
| |
| addContent | back to summary |
|---|---|
| public Document addContent(Collection<E> c) Appends all children in the given collection to the end of the content list. In event of an exception during add the original content will be unchanged and the objects in the supplied collection will be unaltered.
| |
| addContent | back to summary |
|---|---|
| public Document addContent(int index, Content child) Inserts the child into the content list at the given index.
| |
| addContent | back to summary |
|---|---|
| public Document addContent(int index, Collection<E> c) Inserts the content in a collection into the content list at the given index. In event of an exception the original content will be unchanged and the objects in the supplied collection will be unaltered.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Implements org. This will return a deep clone of this
| |
| cloneContent | back to summary |
|---|---|
| public List Implements org. Doc from org. Returns a list containing detached clones of this parent's content list.
| |
| detachRootElement | back to summary |
|---|---|
| public Element detachRootElement() Detach the root
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object ob) Overrides java. This tests for equality of this
| |
| getBaseURI | back to summary |
|---|---|
| public final String getBaseURI() Returns the URI from which this document was loaded, or null if this is not known.
| |
| getContent | back to summary |
|---|---|
| public Content getContent(int index) Implements org. Doc from org. Returns the child at the given index.
| |
| getContent | back to summary |
|---|---|
| public List Implements org. 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.
| |
| getContent | back to summary |
|---|---|
| public List Implements org. 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.
| |
| getContentSize | back to summary |
|---|---|
| public int getContentSize() Implements org. Doc from org. Returns the number of children in this parent's content list.
Children may be any
| |
| getDescendants | back to summary |
|---|---|
| public Iterator Implements org. Returns an iterator that walks over all descendants in document order.
| |
| getDescendants | back to summary |
|---|---|
| public Iterator Implements org. Returns an iterator that walks over all descendants in document order applying the Filter to return only elements that match the filter rule. With filters you can match only Elements, only Comments, Elements or Comments, only Elements with a given name and/or prefix, and so on. | |
| getDocType | back to summary |
|---|---|
| public DocType getDocType() This will return the
| |
| getDocument | back to summary |
|---|---|
| public Document getDocument() Implements org. Doc from org. Return this parent's owning document or null if the branch containing this parent is currently not attached to a document.
| |
| getParent | back to summary |
|---|---|
| public Parent getParent() Implements org. Doc from org. Return this parent's parent, or null if this parent is currently not attached to another parent. This is the same method as in Content but also added to Parent to allow more easy up-the-tree walking.
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String id) Returns the object associated with this document under the given "id" string, or null if there is no binding or if the binding explicitly stored a null value. | |
| getRootElement | back to summary |
|---|---|
| public Element getRootElement() This will return the root
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. This returns the hash code for this
| |
| hasRootElement | back to summary |
|---|---|
| public boolean hasRootElement() This will return
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(Content child) Implements org. Doc from org. Returns the index of the supplied child in the content list, or -1 if not a child of this parent.
| |
| removeContent | back to summary |
|---|---|
| public List Implements org. Removes all child content from this parent.
| |
| removeContent | back to summary |
|---|---|
| public List Implements org. Remove all child content from this parent matching the supplied filter. | |
| removeContent | back to summary |
|---|---|
| public boolean removeContent(Content child) Implements org. Doc from org. Removes a single child node from the content list.
| |
| removeContent | back to summary |
|---|---|
| public Content removeContent(int index) Implements org. Doc from org. Removes and returns the child at the given index, or returns null if there's no such child.
| |
| setBaseURI | back to summary |
|---|---|
| public final void setBaseURI(String uri) Sets the effective URI from which this document was loaded, and against which relative URLs in this document will be resolved.
| |
| setContent | back to summary |
|---|---|
| public Document setContent(Collection<E> newContent) 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 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.
| |
| setContent | back to summary |
|---|---|
| public Document setContent(int index, Content child) | |
| setContent | back to summary |
|---|---|
| public Document setContent(int index, Collection<E> collection) Replace the child at the given index whith the supplied collection. In event of an exception the original content will be unchanged and the content in the supplied collection will be unaltered.
| |
| setContent | back to summary |
|---|---|
| public Document setContent(Content child) Set this document's content to be the supplied child. If the supplied child is legal content for a Document and before it is added, all content in the current content list will be cleared and all current children will have their parentage set to null.
This has the effect that any active list (previously obtained with
a call to one of the Passing a null child clears the existing content. In event of an exception the original content will be unchanged and the supplied child will be unaltered.
| |
| setDocType | back to summary |
|---|---|
| public Document setDocType(DocType docType) This will set the
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(String id, Object value) Assigns an arbitrary object to be associated with this document under the given "id" string. Null values are permitted. Strings beginning with "http://www.jdom.org/ are reserved for JDOM use. | |
| setRootElement | back to summary |
|---|---|
| public Document setRootElement(Element rootElement) This sets the root
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. This returns a
| |