Top Description Fields Constructors Methods
org.dom4j.io

public Class DOMWriter

extends Object
Class Inheritance
Imports
java.util.List, org.dom4j.*, org.dom4j.dtd.Decl, org.dom4j.tree.NamespaceStack, org.w3c.dom.DOMImplementation

DOMWriter takes a DOM4J tree and outputs it as a W3C DOM object
Author
James Strachan
Version
$Revision: 1.17 $

Field Summary

Modifier and TypeField and Description
private static final String[]
private Class<?>
private static boolean
private NamespaceStack
namespaceStack

stack of Namespace objects

Constructor Summary

AccessConstructor and Description
public
public
DOMWriter(Class<?> domDocumentClass)

Method Summary

Modifier and TypeMethod and Description
protected void
appendDOMTree(Document domDocument, Node domCurrent, List<Node> content)

protected void
appendDOMTree(Document domDocument, Node domCurrent, Element element)

protected void
appendDOMTree(Document domDocument, Node domCurrent, CDATA cdata)

protected void
appendDOMTree(Document domDocument, Node domCurrent, Comment comment)

protected void
appendDOMTree(Document domDocument, Node domCurrent, String text)

protected void
appendDOMTree(Document domDocument, Node domCurrent, Entity entity)

protected void
protected String
protected Document
protected Document
protected Document
public Class<?>
protected boolean
protected void
public void
setDomDocumentClass(Class<?>
is the Class implementing the org.w3c.dom.Document interface
domDocumentClass
)

Sets the DOM org.w3c.dom.Documentimplementation class used by the writer when creating DOM documents.

public void
setDomDocumentClassName(String
is the name of the Class implementing the org.w3c.dom.Document interface
name
)

Sets the DOM org.w3c.dom.Documentimplementation class name used by the writer when creating DOM documents.

public Document
write(Document document)

public Document
write(Document document, DOMImplementation domImpl)

protected void
writeNamespace(Element domElement, Namespace namespace)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_DOM_DOCUMENT_CLASSESback to summary
private static final String[] DEFAULT_DOM_DOCUMENT_CLASSES
domDocumentClassback to summary
private Class<?> domDocumentClass
loggedWarningback to summary
private static boolean loggedWarning
namespaceStackback to summary
private NamespaceStack namespaceStack

stack of Namespace objects

Constructor Detail

DOMWriterback to summary
public DOMWriter()
DOMWriterback to summary
public DOMWriter(Class<?> domDocumentClass)

Method Detail

appendDOMTreeback to summary
protected void appendDOMTree(Document domDocument, Node domCurrent, List<Node> content)
appendDOMTreeback to summary
protected void appendDOMTree(Document domDocument, Node domCurrent, Element element)
appendDOMTreeback to summary
protected void appendDOMTree(Document domDocument, Node domCurrent, CDATA cdata)
appendDOMTreeback to summary
protected void appendDOMTree(Document domDocument, Node domCurrent, Comment comment)
appendDOMTreeback to summary
protected void appendDOMTree(Document domDocument, Node domCurrent, String text)
appendDOMTreeback to summary
protected void appendDOMTree(Document domDocument, Node domCurrent, Entity entity)
appendDOMTreeback to summary
protected void appendDOMTree(Document domDoc, Node domCurrent, ProcessingInstruction pi)
attributeNameForNamespaceback to summary
protected String attributeNameForNamespace(Namespace namespace)
createDomDocumentback to summary
protected Document createDomDocument(Document document) throws DocumentException
createDomDocumentback to summary
protected Document createDomDocument(Document document, DOMImplementation domImpl) throws DocumentException
createDomDocumentViaJAXPback to summary
protected Document createDomDocumentViaJAXP() throws DocumentException
getDomDocumentClassback to summary
public Class<?> getDomDocumentClass() throws DocumentException
isNamespaceDeclarationback to summary
protected boolean isNamespaceDeclaration(Namespace ns)
resetNamespaceStackback to summary
protected void resetNamespaceStack()
setDomDocumentClassback to summary
public void setDomDocumentClass(Class<?> domDocumentClass)

Sets the DOM org.w3c.dom.Documentimplementation class used by the writer when creating DOM documents.

Parameters
domDocumentClass:Class<?>

is the Class implementing the org.w3c.dom.Document interface

setDomDocumentClassNameback to summary
public void setDomDocumentClassName(String name) throws DocumentException

Sets the DOM org.w3c.dom.Documentimplementation class name used by the writer when creating DOM documents.

Parameters
name:String

is the name of the Class implementing the org.w3c.dom.Document interface

Exceptions
DocumentException:
if the class could not be loaded
writeback to summary
public Document write(Document document) throws DocumentException
writeback to summary
public Document write(Document document, DOMImplementation domImpl) throws DocumentException
writeNamespaceback to summary
protected void writeNamespace(Element domElement, Namespace namespace)