Package org.dom4j.io
Class DOMWriter
- java.lang.Object
-
- org.dom4j.io.DOMWriter
-
public class DOMWriter extends java.lang.ObjectDOMWritertakes a DOM4J tree and outputs it as a W3C DOM object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, java.lang.String text)protected voidappendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, java.util.List<Node> content)protected voidappendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, CDATA cdata)protected voidappendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, Comment comment)protected voidappendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, Element element)protected voidappendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, Entity entity)protected voidappendDOMTree(org.w3c.dom.Document domDoc, org.w3c.dom.Node domCurrent, ProcessingInstruction pi)protected java.lang.StringattributeNameForNamespace(Namespace namespace)protected org.w3c.dom.DocumentcreateDomDocument(Document document)protected org.w3c.dom.DocumentcreateDomDocument(Document document, org.w3c.dom.DOMImplementation domImpl)protected org.w3c.dom.DocumentcreateDomDocumentViaJAXP()java.lang.Class<?>getDomDocumentClass()protected booleanisNamespaceDeclaration(Namespace ns)protected voidresetNamespaceStack()voidsetDomDocumentClass(java.lang.Class<?> domDocumentClass)Sets the DOMDocumentimplementation class used by the writer when creating DOM documents.voidsetDomDocumentClassName(java.lang.String name)Sets the DOMDocumentimplementation class name used by the writer when creating DOM documents.org.w3c.dom.Documentwrite(Document document)org.w3c.dom.Documentwrite(Document document, org.w3c.dom.DOMImplementation domImpl)protected voidwriteNamespace(org.w3c.dom.Element domElement, Namespace namespace)
-
-
-
Method Detail
-
getDomDocumentClass
public java.lang.Class<?> getDomDocumentClass() throws DocumentException- Throws:
DocumentException
-
setDomDocumentClass
public void setDomDocumentClass(java.lang.Class<?> domDocumentClass)
Sets the DOMDocumentimplementation class used by the writer when creating DOM documents.- Parameters:
domDocumentClass- is the Class implementing theDocumentinterface
-
setDomDocumentClassName
public void setDomDocumentClassName(java.lang.String name) throws DocumentExceptionSets the DOMDocumentimplementation class name used by the writer when creating DOM documents.- Parameters:
name- is the name of the Class implementing theDocumentinterface- Throws:
DocumentException- if the class could not be loaded
-
write
public org.w3c.dom.Document write(Document document) throws DocumentException
- Throws:
DocumentException
-
write
public org.w3c.dom.Document write(Document document, org.w3c.dom.DOMImplementation domImpl) throws DocumentException
- Throws:
DocumentException
-
appendDOMTree
protected void appendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, java.util.List<Node> content)
-
appendDOMTree
protected void appendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, Element element)
-
appendDOMTree
protected void appendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, CDATA cdata)
-
appendDOMTree
protected void appendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, Comment comment)
-
appendDOMTree
protected void appendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, java.lang.String text)
-
appendDOMTree
protected void appendDOMTree(org.w3c.dom.Document domDocument, org.w3c.dom.Node domCurrent, Entity entity)
-
appendDOMTree
protected void appendDOMTree(org.w3c.dom.Document domDoc, org.w3c.dom.Node domCurrent, ProcessingInstruction pi)
-
writeNamespace
protected void writeNamespace(org.w3c.dom.Element domElement, Namespace namespace)
-
attributeNameForNamespace
protected java.lang.String attributeNameForNamespace(Namespace namespace)
-
createDomDocument
protected org.w3c.dom.Document createDomDocument(Document document) throws DocumentException
- Throws:
DocumentException
-
createDomDocumentViaJAXP
protected org.w3c.dom.Document createDomDocumentViaJAXP() throws DocumentException- Throws:
DocumentException
-
createDomDocument
protected org.w3c.dom.Document createDomDocument(Document document, org.w3c.dom.DOMImplementation domImpl) throws DocumentException
- Throws:
DocumentException
-
isNamespaceDeclaration
protected boolean isNamespaceDeclaration(Namespace ns)
-
resetNamespaceStack
protected void resetNamespaceStack()
-
-