public interface

HierarchicalStreamReader

com.thoughtworks.xstream.io.HierarchicalStreamReader
Known Indirect Subclasses

Summary

Public Methods
abstract void appendErrors(ErrorWriter errorWriter)
If any errors are detected, allow the reader to add any additional information that can aid debugging (such as line numbers, XPath expressions, etc).
abstract void close()
Close the reader, if necessary.
abstract String getAttribute(int index)
Get the value of an attribute of the current node, by index.
abstract String getAttribute(String name)
Get the value of an attribute of the current node.
abstract int getAttributeCount()
Number of attributes in current node.
abstract String getAttributeName(int index)
Name of attribute in current node.
abstract Iterator getAttributeNames()
Names of attributes (as Strings).
abstract String getNodeName()
Get the name of the current node.
abstract String getValue()
Get the value (text content) of the current node.
abstract boolean hasMoreChildren()
Does the node have any more children remaining that have not yet been read?
abstract void moveDown()
Select the current child as current node.
abstract void moveUp()
Select the parent node as current node.
abstract HierarchicalStreamReader underlyingReader()
Return the underlying HierarchicalStreamReader implementation.

Public Methods

public abstract void appendErrors (ErrorWriter errorWriter)

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 abstract void close ()

Close the reader, if necessary.

public abstract String getAttribute (int index)

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

public abstract String getAttribute (String name)

Get the value of an attribute of the current node.

public abstract int getAttributeCount ()

Number of attributes in current node.

public abstract String getAttributeName (int index)

Name of attribute in current node.

public abstract Iterator getAttributeNames ()

Names of attributes (as Strings).

public abstract String getNodeName ()

Get the name of the current node.

public abstract String getValue ()

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

public abstract boolean hasMoreChildren ()

Does the node have any more children remaining that have not yet been read?

public abstract void moveDown ()

Select the current child as current node. A call to this function must be balanced with a call to moveUp().

public abstract void moveUp ()

Select the parent node as current node.

public abstract HierarchicalStreamReader underlyingReader ()

Return the underlying HierarchicalStreamReader implementation.

If a Converter needs to access methods of a specific HierarchicalStreamReader implementation that are not defined in the HierarchicalStreamReader interface, it should call this method before casting. This is because the reader passed to the Converter is often wrapped/decorated by another implementation to provide additional functionality (such as XPath tracking).

For example:

MySpecificReader mySpecificReader = (MySpecificReader)reader; // INCORRECT!
 mySpecificReader.doSomethingSpecific();
MySpecificReader mySpecificReader = (MySpecificReader)reader.underlyingReader();  // CORRECT!
 mySpecificReader.doSomethingSpecific();

Implementations of HierarchicalStreamReader should return 'this', unless they are a decorator, in which case they should delegate to whatever they are wrapping.