public class DOMWriter extends Object
DOMWriter
takes a DOM4J tree and outputs
it as a W3C DOM object
Modifier and Type | Field and Description |
---|---|
private static String[] |
DEFAULT_DOM_DOCUMENT_CLASSES |
private Class |
domDocumentClass |
private static boolean |
loggedWarning |
private NamespaceStack |
namespaceStack
stack of
Namespace objects |
Constructor and Description |
---|
DOMWriter() |
DOMWriter(Class domDocumentClass) |
Modifier and Type | Method and Description |
---|---|
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 domDocument,
Node domCurrent,
List content) |
protected void |
appendDOMTree(Document domDocument,
Node domCurrent,
ProcessingInstruction pi) |
protected void |
appendDOMTree(Document domDocument,
Node domCurrent,
String text) |
protected String |
attributeNameForNamespace(Namespace namespace) |
protected Document |
createDomDocument(Document document) |
protected Document |
createDomDocument(Document document,
DOMImplementation domImplementation) |
protected Document |
createDomDocumentViaJAXP() |
Class |
getDomDocumentClass() |
protected boolean |
isNamespaceDeclaration(Namespace ns) |
protected void |
resetNamespaceStack() |
void |
setDomDocumentClass(Class domDocumentClass)
Sets the DOM
Document implementation
class used by the writer when creating DOM documents. |
void |
setDomDocumentClassName(String className)
Sets the DOM
Document implementation
class name used by the writer when creating DOM documents. |
Document |
write(Document document) |
Document |
write(Document document,
DOMImplementation domImplementation) |
protected void |
writeNamespace(Element domElement,
Namespace namespace) |
private static boolean loggedWarning
private static final String[] DEFAULT_DOM_DOCUMENT_CLASSES
private Class domDocumentClass
private NamespaceStack namespaceStack
Namespace
objectspublic Class getDomDocumentClass() throws DocumentException
DocumentException
public void setDomDocumentClass(Class domDocumentClass)
Document
implementation
class used by the writer when creating DOM documents.domDocumentClass
- is the Class implementing
the Document
interfacepublic void setDomDocumentClassName(String className) throws DocumentException
Document
implementation
class name used by the writer when creating DOM documents.className
- is the name of the Class implementing
the Document
interfaceDocumentException
- if the class could not be loadedpublic Document write(Document document) throws DocumentException
DocumentException
public Document write(Document document, DOMImplementation domImplementation) throws DocumentException
DocumentException
protected void appendDOMTree(Document domDocument, Node domCurrent, List 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 appendDOMTree(Document domDocument, Node domCurrent, ProcessingInstruction pi)
protected void writeNamespace(Element domElement, Namespace namespace)
protected String attributeNameForNamespace(Namespace namespace)
protected Document createDomDocument(Document document) throws DocumentException
DocumentException
protected Document createDomDocumentViaJAXP() throws DocumentException
DocumentException
protected Document createDomDocument(Document document, DOMImplementation domImplementation) throws DocumentException
DocumentException
protected boolean isNamespaceDeclaration(Namespace ns)
protected void resetNamespaceStack()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses