Top Fields Constructors Methods
com.thoughtworks.xstream.io.xml

public Class Dom4JReader

extends AbstractDocumentReader
Class Inheritance
Imports
com.thoughtworks.xstream.converters.ErrorWriter, com.thoughtworks.xstream.io.naming.NameCoder, java.util.List, org.dom4j.Branch, .Document, .Element

Deprecated

as a consequence of AbstractDocumentReader being deprecated. See corresponding docs for further information.

Field Summary

Modifier and TypeField and Description
private Element

Constructor Summary

AccessConstructor and Description
public
Dom4JReader(final Branch branch)

public
Dom4JReader(final Element rootElement)

public
public
Dom4JReader(Element rootElement, NameCoder nameCoder)

public
Dom4JReader(Document document, NameCoder nameCoder)

public
Dom4JReader(Element rootElement, XmlFriendlyReplacer replacer)

Deprecated As of 1.4, use Dom4JReader#Dom4JReader(Element, NameCoder) instead
public
Dom4JReader(Document document, XmlFriendlyReplacer replacer)

Deprecated As of 1.4, use Dom4JReader#Dom4JReader(Document, NameCoder) instead

Method Summary

Modifier and TypeMethod and Description
public void
appendErrors(ErrorWriter
the error writer
errorWriter
)

Overrides com.thoughtworks.xstream.io.xml.AbstractDocumentReader.appendErrors.

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.appendErrors.

If any errors are detected, allow the reader to add any additional information that can aid debugging (such as line numbers, XPath expressions, etc).
public String
getAttribute(String name)

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttribute.

Get the value of an attribute of the current node.
public String
getAttribute(int index)

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttribute.

Get the value of an attribute of the current node, by index.
public int
public String
getAttributeName(int index)

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttributeName.

Name of attribute in current node.
protected Object
protected int
public String
protected Object
public String
getValue()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getValue.

Get the value (text content) of the current node.
public String
protected void
Inherited from com.thoughtworks.xstream.io.xml.AbstractDocumentReader:
closegetAttributeNamesgetCurrenthasMoreChildrenmoveDownmoveUp

Field Detail

currentElementback to summary
private Element currentElement

Constructor Detail

Dom4JReaderback to summary
public Dom4JReader(final Branch branch)
Since
1.4.11
Dom4JReaderback to summary
public Dom4JReader(final Element rootElement)
Dom4JReaderback to summary
public Dom4JReader(Document document)
Dom4JReaderback to summary
public Dom4JReader(Element rootElement, NameCoder nameCoder)
Since
1.4
Dom4JReaderback to summary
public Dom4JReader(Document document, NameCoder nameCoder)
Since
1.4
Dom4JReaderback to summary
public Dom4JReader(Element rootElement, XmlFriendlyReplacer replacer)

Deprecated

As of 1.4, use Dom4JReader#Dom4JReader(Element, NameCoder) instead

Since
1.2
Dom4JReaderback to summary
public Dom4JReader(Document document, XmlFriendlyReplacer replacer)

Deprecated

As of 1.4, use Dom4JReader#Dom4JReader(Document, NameCoder) instead

Since
1.2

Method Detail

appendErrorsback to summary
public void appendErrors(ErrorWriter errorWriter)

Overrides com.thoughtworks.xstream.io.xml.AbstractDocumentReader.appendErrors.

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.appendErrors.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.appendErrors.

If any errors are detected, allow the reader to add any additional information that can aid debugging (such as line numbers, XPath expressions, etc).

Parameters
errorWriter:ErrorWriter

Doc from com.thoughtworks.xstream.converters.ErrorReporter.appendErrors.

the error writer

getAttributeback to summary
public String getAttribute(String name)

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttribute.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttribute.

Get the value of an attribute of the current node.

If no such attribute exists, the method returns null.

getAttributeback to summary
public String getAttribute(int index)

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttribute.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttribute.

Get the value of an attribute of the current node, by index.

Note, the behavior of this method is dependent on the underlying parser when calling it with a non-existing index. Typically some kind of RuntimeException is thrown.

getAttributeCountback to summary
public int getAttributeCount()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttributeCount.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttributeCount.

Number of attributes in current node.

getAttributeNameback to summary
public String getAttributeName(int index)

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttributeName.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttributeName.

Name of attribute in current node.

Note, the behavior of this method is dependent on the underlying parser when calling it with a non-existing index. Typically some kind of RuntimeException is thrown.

getChildback to summary
protected Object getChild(int index)

Implements abstract com.thoughtworks.xstream.io.xml.AbstractDocumentReader.getChild.

getChildCountback to summary
protected int getChildCount()

Implements abstract com.thoughtworks.xstream.io.xml.AbstractDocumentReader.getChildCount.

getNodeNameback to summary
public String getNodeName()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getNodeName.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.getNodeName.

Get the name of the current node.

getParentback to summary
protected Object getParent()

Implements abstract com.thoughtworks.xstream.io.xml.AbstractDocumentReader.getParent.

getValueback to summary
public String getValue()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getValue.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.getValue.

Get the value (text content) of the current node.

peekNextChildback to summary
public String peekNextChild()

Overrides com.thoughtworks.xstream.io.AbstractReader.peekNextChild.

Implements com.thoughtworks.xstream.io.ExtendedHierarchicalStreamReader.peekNextChild.

Doc from com.thoughtworks.xstream.io.ExtendedHierarchicalStreamReader.peekNextChild.

Peek the name of the next child. In situation where hasMoreChildren() returns true, peek the tag name of the child.

reassignCurrentElementback to summary
protected void reassignCurrentElement(Object current)

Implements abstract com.thoughtworks.xstream.io.xml.AbstractDocumentReader.reassignCurrentElement.