Top Description Fields Constructors Methods
org.dom4j.io

public Class DOMReader

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, org.dom4j.*, org.dom4j.dom.DOMAttribute, org.dom4j.tree.NamespaceStack

DOMReader navigates a W3C DOM tree and creates a DOM4J tree from it.

Author
James Strachan
Version
$Revision: 1.17 $

Field Summary

Modifier and TypeField and Description
private DocumentFactory
factory

DocumentFactory used to create new document objects

private NamespaceStack
namespaceStack

stack of Namespace and QName objects

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected void
protected Document
public DocumentFactory

Returns:

the DocumentFactory used to create document objects
getDocumentFactory
()

DOCUMENT ME!

protected Namespace
getNamespace(String prefix, String uri)

private String
getPrefix(String xmlnsDecl)

public Document
read(Document domDocument)

protected void
readElement(Node node, Branch current)

protected void
readTree(Node node, Branch current)

public void
setDocumentFactory(DocumentFactory
DocumentFactory used to create DOM4J objects
docFactory
)

This sets the DocumentFactory used to create new documents.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

factoryback to summary
private DocumentFactory factory

DocumentFactory used to create new document objects

namespaceStackback to summary
private NamespaceStack namespaceStack

stack of Namespace and QName objects

Constructor Detail

DOMReaderback to summary
public DOMReader()
DOMReaderback to summary
public DOMReader(DocumentFactory factory)

Method Detail

clearNamespaceStackback to summary
protected void clearNamespaceStack()
createDocumentback to summary
protected Document createDocument()
getDocumentFactoryback to summary
public DocumentFactory getDocumentFactory()

DOCUMENT ME!

Returns:DocumentFactory

the DocumentFactory used to create document objects

getNamespaceback to summary
protected Namespace getNamespace(String prefix, String uri)
getPrefixback to summary
private String getPrefix(String xmlnsDecl)
readback to summary
public Document read(Document domDocument)
readElementback to summary
protected void readElement(Node node, Branch current)
readTreeback to summary
protected void readTree(Node node, Branch current)
setDocumentFactoryback to summary
public void setDocumentFactory(DocumentFactory docFactory)

This sets the DocumentFactory used to create new documents. This method allows the building of custom DOM4J tree objects to be implemented easily using a custom derivation of DocumentFactory

Parameters
docFactory:DocumentFactory

DocumentFactory used to create DOM4J objects