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

public Class DomReader

extends AbstractDocumentReader
Class Inheritance
Imports
com.thoughtworks.xstream.io.naming.NameCoder, org.w3c.dom.Attr, .Document, .Element, .Node, .NodeList, .Text, java.util.ArrayList, .List

Deprecated

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

Field Summary

Modifier and TypeField and Description
private List<E>
private Element
private StringBuffer

Constructor Summary

AccessConstructor and Description
public
DomReader(Element rootElement)

public
DomReader(Document document)

public
DomReader(Element rootElement, NameCoder nameCoder)

public
DomReader(Document document, NameCoder nameCoder)

public
DomReader(Element rootElement, XmlFriendlyReplacer replacer)

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

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

Method Summary

Modifier and TypeMethod and Description
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:
appendErrorsclosegetAttributeNamesgetCurrenthasMoreChildrenmoveDownmoveUp

Field Detail

childElementsback to summary
private List<E> childElements
currentElementback to summary
private Element currentElement
textBufferback to summary
private StringBuffer textBuffer

Constructor Detail

DomReaderback to summary
public DomReader(Element rootElement)
DomReaderback to summary
public DomReader(Document document)
DomReaderback to summary
public DomReader(Element rootElement, NameCoder nameCoder)
Since
1.4
DomReaderback to summary
public DomReader(Document document, NameCoder nameCoder)
Since
1.4
DomReaderback to summary
public DomReader(Element rootElement, XmlFriendlyReplacer replacer)

Deprecated

As of 1.4, use DomReader#DomReader(Element, NameCoder) instead.

Since
1.2
DomReaderback to summary
public DomReader(Document document, XmlFriendlyReplacer replacer)

Deprecated

As of 1.4, use DomReader#DomReader(Document, NameCoder) instead.

Since
1.2

Method Detail

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.