Package org.dom4j.io
Class DOMWriter
- java.lang.Object
-
- org.dom4j.io.DOMWriter
-
public class DOMWriter extends Object
DOMWriter
takes 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 void
appendDOMTree(Document domDocument, Node domCurrent, String text)
protected void
appendDOMTree(Document domDocument, Node domCurrent, List<Node> content)
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, Element element)
protected void
appendDOMTree(Document domDocument, Node domCurrent, Entity entity)
protected void
appendDOMTree(Document domDoc, Node domCurrent, ProcessingInstruction pi)
protected String
attributeNameForNamespace(Namespace namespace)
protected Document
createDomDocument(Document document)
protected Document
createDomDocument(Document document, DOMImplementation domImpl)
protected Document
createDomDocumentViaJAXP()
Class<?>
getDomDocumentClass()
protected boolean
isNamespaceDeclaration(Namespace ns)
protected void
resetNamespaceStack()
void
setDomDocumentClass(Class<?> domDocumentClass)
Sets the DOMDocument
implementation class used by the writer when creating DOM documents.void
setDomDocumentClassName(String name)
Sets the DOMDocument
implementation class name used by the writer when creating DOM documents.Document
write(Document document)
Document
write(Document document, DOMImplementation domImpl)
protected void
writeNamespace(Element domElement, Namespace namespace)
-
-
-
Constructor Detail
-
DOMWriter
public DOMWriter()
-
DOMWriter
public DOMWriter(Class<?> domDocumentClass)
-
-
Method Detail
-
getDomDocumentClass
public Class<?> getDomDocumentClass() throws DocumentException
- Throws:
DocumentException
-
setDomDocumentClass
public void setDomDocumentClass(Class<?> domDocumentClass)
Sets the DOMDocument
implementation class used by the writer when creating DOM documents.- Parameters:
domDocumentClass
- is the Class implementing theDocument
interface
-
setDomDocumentClassName
public void setDomDocumentClassName(String name) throws DocumentException
Sets the DOMDocument
implementation class name used by the writer when creating DOM documents.- Parameters:
name
- is the name of the Class implementing theDocument
interface- Throws:
DocumentException
- if the class could not be loaded
-
write
public Document write(Document document) throws DocumentException
- Throws:
DocumentException
-
write
public Document write(Document document, DOMImplementation domImpl) throws DocumentException
- Throws:
DocumentException
-
appendDOMTree
protected void appendDOMTree(Document domDocument, Node domCurrent, List<Node> content)
-
appendDOMTree
protected void appendDOMTree(Document domDoc, Node domCurrent, ProcessingInstruction pi)
-
createDomDocument
protected Document createDomDocument(Document document) throws DocumentException
- Throws:
DocumentException
-
createDomDocumentViaJAXP
protected Document createDomDocumentViaJAXP() throws DocumentException
- Throws:
DocumentException
-
createDomDocument
protected Document createDomDocument(Document document, DOMImplementation domImpl) throws DocumentException
- Throws:
DocumentException
-
isNamespaceDeclaration
protected boolean isNamespaceDeclaration(Namespace ns)
-
resetNamespaceStack
protected void resetNamespaceStack()
-
-