|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.dom4j.tree.AbstractNode
|
+--org.dom4j.tree.AbstractBranch
|
+--org.dom4j.tree.AbstractDocument
|
+--org.dom4j.tree.DefaultDocument
DefaultDocument is the default DOM4J default implementation
of an XML document.
| Field Summary | |
protected static Iterator |
EMPTY_ITERATOR
|
protected static List |
EMPTY_LIST
|
| Fields inherited from class org.dom4j.tree.AbstractBranch |
DEFAULT_CONTENT_LIST_SIZE, outputFormat |
| Fields inherited from class org.dom4j.tree.AbstractNode |
NODE_TYPE_NAMES |
| Fields inherited from interface org.dom4j.Node |
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE |
| Constructor Summary | |
DefaultDocument()
|
|
DefaultDocument(DocumentType docType)
|
|
DefaultDocument(Element rootElement)
|
|
DefaultDocument(Element rootElement,
DocumentType docType)
|
|
DefaultDocument(String name)
|
|
DefaultDocument(String name,
Element rootElement,
DocumentType docType)
|
|
| Method Summary | |
Document |
addDocType(String name,
String publicId,
String systemId)
Adds a DOCTYPE declaration to this document |
protected void |
addNode(Node node)
|
void |
clearContent()
Clears the content for this branch, removing any Node
instances this branch may contain. |
Object |
clone()
clone will return a deep clone or if this node is
read-only then clone will return the same instance. |
protected List |
contentList()
|
DocumentType |
getDocType()
|
protected DocumentFactory |
getDocumentFactory()
|
EntityResolver |
getEntityResolver()
|
String |
getName()
getName returns the name of this node. |
Element |
getRootElement()
Returns the root Element for this document. |
ProcessingInstruction |
processingInstruction(String target)
|
List |
processingInstructions()
Returns a list of all the processing instructions in this branch. |
List |
processingInstructions(String target)
Returns a list of the processing instructions for the given target. |
protected boolean |
removeNode(Node node)
|
boolean |
removeProcessingInstruction(String target)
Removes the processing instruction for the given target if it exists |
protected void |
rootElementAdded(Element element)
Called to set the root element variable |
void |
setContent(List content)
Sets the contents of this branch as a List of
Node instances. |
void |
setDocType(DocumentType docType)
Sets the DocumentType property |
void |
setDocumentFactory(DocumentFactory documentFactory)
|
void |
setEntityResolver(EntityResolver entityResolver)
Sets the EntityResolver used to find resolve URIs such as for DTDs, or XML Schema documents |
void |
setName(String name)
Sets the text data of this node or this method will throw an UnsupportedOperationException if it is
read-only. |
| Methods inherited from class org.dom4j.tree.AbstractDocument |
accept, add, addComment, addElement, addElement, addElement, addProcessingInstruction, addProcessingInstruction, asXML, asXPathResult, checkAddElementAllowed, childAdded, childRemoved, getDocument, getNodeType, getPath, getStringValue, getUniquePath, normalize, remove, setRootElement, toString, write |
| Methods inherited from class org.dom4j.tree.AbstractBranch |
add, add, add, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getText, getTextTrim, hasContent, indexOf, invalidNodeTypeAddException, isReadOnly, node, nodeCount, nodeIterator, remove, remove, remove, setProcessingInstructions |
| Methods inherited from class org.dom4j.tree.AbstractNode |
createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getParent, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOf |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.dom4j.Branch |
add, add, add, appendContent, content, elementByID, indexOf, node, nodeCount, nodeIterator, remove, remove, remove, setProcessingInstructions |
| Methods inherited from interface org.dom4j.Node |
createXPath, detach, getNodeTypeName, getParent, getPath, getText, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOf |
| Field Detail |
protected static final List EMPTY_LIST
protected static final Iterator EMPTY_ITERATOR
| Constructor Detail |
public DefaultDocument()
public DefaultDocument(String name)
public DefaultDocument(Element rootElement)
public DefaultDocument(DocumentType docType)
public DefaultDocument(Element rootElement,
DocumentType docType)
public DefaultDocument(String name,
Element rootElement,
DocumentType docType)
| Method Detail |
public String getName()
NodegetName returns the name of this node.
This is the XML local name of the element, attribute, entity or
processing instruction.
For CDATA and Text nodes this method will return null.
getName in interface NodegetName in class AbstractNodepublic void setName(String name)
NodeSets the text data of this node or this method will
throw an UnsupportedOperationException if it is
read-only.
setName in interface NodesetName in class AbstractNodename - is the new name of this nodepublic Element getRootElement()
DocumentElement for this document.
public DocumentType getDocType()
public void setDocType(DocumentType docType)
Document
public Document addDocType(String name,
String publicId,
String systemId)
Document
name - is the name of the root elementpublicId - is the PUBLIC URIsystemId - is the SYSTEM URI
Document instance.public EntityResolver getEntityResolver()
public void setEntityResolver(EntityResolver entityResolver)
Document
public Object clone()
Nodeclone will return a deep clone or if this node is
read-only then clone will return the same instance.
clone in interface Nodeclone in class AbstractNodepublic List processingInstructions()
BranchReturns a list of all the processing instructions in this branch. The list is backed by this branch so that changes to the list will be reflected in the branch but the reverse is not the case.
public List processingInstructions(String target)
BranchReturns a list of the processing instructions for the given target. The list is backed by this branch so that changes to the list will be reflected in the branch but the reverse is not the case.
public ProcessingInstruction processingInstruction(String target)
public boolean removeProcessingInstruction(String target)
Branch
public void setContent(List content)
BranchList of
Node instances.
content - is the list of nodes to use as the content for this
branch.public void clearContent()
BranchNode
instances this branch may contain.
public void setDocumentFactory(DocumentFactory documentFactory)
protected List contentList()
contentList in class AbstractBranchprotected void addNode(Node node)
addNode in class AbstractBranchprotected boolean removeNode(Node node)
removeNode in class AbstractBranchprotected void rootElementAdded(Element element)
AbstractDocument
rootElementAdded in class AbstractDocumentprotected DocumentFactory getDocumentFactory()
getDocumentFactory in class AbstractNode
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||