org.dom4j
Interface Document

All Superinterfaces:
Branch, java.lang.Cloneable, Node
All Known Implementing Classes:
AbstractDocument

public interface Document
extends Branch

Document defines an XML Document.

Version:
$Revision: 1.8 $
Author:
James Strachan

Field Summary
 
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
 
Method Summary
 Document addComment(java.lang.String comment)
          Adds a new Comment node with the given text to this branch.
 Document addDocType(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Adds a DOCTYPE declaration to this document
 Document addProcessingInstruction(java.lang.String target, java.util.Map data)
          Adds a processing instruction for the given target
 Document addProcessingInstruction(java.lang.String target, java.lang.String text)
          Adds a processing instruction for the given target
 DocumentType getDocType()
           
 org.xml.sax.EntityResolver getEntityResolver()
           
 Element getRootElement()
          Returns the root Element for this document.
 void setDocType(DocumentType docType)
          Sets the DocumentType property
 void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
          Sets the EntityResolver used to find resolve URIs such as for DTDs, or XML Schema documents
 void setRootElement(Element rootElement)
          Sets the root element for this document
 
Methods inherited from interface org.dom4j.Branch
add, add, add, add, addElement, addElement, addElement, appendContent, clearContent, content, elementByID, indexOf, node, nodeCount, nodeIterator, normalize, processingInstruction, processingInstructions, processingInstructions, remove, remove, remove, remove, removeProcessingInstruction, setContent, setProcessingInstructions
 
Methods inherited from interface org.dom4j.Node
accept, asXML, asXPathResult, clone, createXPath, detach, getDocument, getName, getNodeType, getNodeTypeName, getParent, getPath, getPath, getStringValue, getText, getUniquePath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, write
 

Method Detail

getRootElement

public Element getRootElement()
Returns the root Element for this document.

Returns:
the root element for this document

setRootElement

public void setRootElement(Element rootElement)
Sets the root element for this document

Parameters:
rootElement - the new root element for this document

addComment

public Document addComment(java.lang.String comment)
Adds a new Comment node with the given text to this branch.

Parameters:
comment - is the text for the Comment node.
Returns:
this Document instance.

addProcessingInstruction

public Document addProcessingInstruction(java.lang.String target,
                                         java.lang.String text)
Adds a processing instruction for the given target

Parameters:
target - is the target of the processing instruction
text - is the textual data (key/value pairs) of the processing instruction
Returns:
this Document instance.

addProcessingInstruction

public Document addProcessingInstruction(java.lang.String target,
                                         java.util.Map data)
Adds a processing instruction for the given target

Parameters:
target - is the target of the processing instruction
data - is a Map of the key / value pairs of the processing instruction
Returns:
this Document instance.

addDocType

public Document addDocType(java.lang.String name,
                           java.lang.String publicId,
                           java.lang.String systemId)
Adds a DOCTYPE declaration to this document

Parameters:
name - is the name of the root element
publicId - is the PUBLIC URI
systemId - is the SYSTEM URI
Returns:
this Document instance.

getDocType

public DocumentType getDocType()
Returns:
the DocumentType property

setDocType

public void setDocType(DocumentType docType)
Sets the DocumentType property


getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()
Returns:
the EntityResolver used to find resolve URIs such as for DTDs, or XML Schema documents

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Sets the EntityResolver used to find resolve URIs such as for DTDs, or XML Schema documents



Copyright © 2001 MetaStuff Ltd. All Rights Reserved. Hosted by

SourceForge Logo