Java org.jdom2 Document fields, constructors, methods, implement or subclass

Example usage for Java org.jdom2 Document fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.jdom2 Document.

The text is from its open source code.

Subclass

org.jdom2.Document has subclasses.
Click this link to see all its subclasses.

Constructor

Document(Element rootElement)
This will create a new Document, with the supplied Element as the root element, and no DocType declaration.
Document(List content)
This will create a new Document, with the supplied list of content, and a DocType declaration only if the content contains a DocType instance.
Document()
Creates a new empty document.
Document(Element rootElement, DocType docType)
This will create a new Document, with the supplied Element as the root element and the supplied DocType declaration.

Method

DocumentaddContent(Content child)
Appends the child to the end of the content list.
DocumentaddContent(Collection c)
Appends all children in the given collection to the end of the content list.
DocumentaddContent(int index, Content child)
Inserts the child into the content list at the given index.
DocumentaddContent(int index, Collection c)
Inserts the content in a collection into the content list at the given index.
Documentclone()
This will return a deep clone of this Document.
ElementdetachRootElement()
Detach the root Element from this document.
StringgetBaseURI()

Returns the URI from which this document was loaded, or null if this is not known.

ListgetContent()
This will return all content for the Document.
ContentgetContent(int index)
ListgetContent(Filter filter)
Return a filtered view of this Document's content.
intgetContentSize()
IteratorIterablegetDescendants(final Filter filter)
Returns an iterator that walks over all descendants in document order applying the Filter to return only elements that match the filter rule.
IteratorIterablegetDescendants()
Returns an iterator that walks over all descendants in document order.
DocTypegetDocType()
This will return the DocType declaration for this Document, or null if none exists.
DocumentgetDocument()
Always returns this Document Instance
ListgetNamespacesInherited()
ElementgetRootElement()
This will return the root Element for this Document
booleanhasRootElement()
This will return true if this document has a root element, false otherwise.
ListremoveContent(Filter filter)
Remove all child content from this parent matching the supplied filter.
booleanremoveContent(Content child)
ContentremoveContent(int index)
DocumentsetContent(Collection newContent)
This sets the content of the Document.
DocumentsetContent(Content child)
Set this document's content to be the supplied child.
DocumentsetDocType(DocType docType)
This will set the DocType declaration for this Document.
DocumentsetRootElement(Element rootElement)
This sets the root Element for the Document.
StringtoString()
This returns a String representation of the Document, suitable for debugging.