com.thoughtworks.xstream.io.path
Class PathTrackingReader

java.lang.Object
  extended bycom.thoughtworks.xstream.io.ReaderWrapper
      extended bycom.thoughtworks.xstream.io.path.PathTrackingReader
All Implemented Interfaces:
HierarchicalStreamReader

public class PathTrackingReader
extends ReaderWrapper

Wrapper for HierarchicalStreamReader that tracks the path (a subset of XPath) of the current node that is being read.

Author:
Joe Walnes
See Also:
PathTracker, Path

Field Summary
 
Fields inherited from class com.thoughtworks.xstream.io.ReaderWrapper
wrapped
 
Constructor Summary
PathTrackingReader(HierarchicalStreamReader reader, PathTracker pathTracker)
           
 
Method Summary
 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).
 void moveDown()
          Select the current child as current node.
 void moveUp()
          Select the parent node as current node.
 
Methods inherited from class com.thoughtworks.xstream.io.ReaderWrapper
close, getAttribute, getAttribute, getAttributeCount, getAttributeName, getAttributeNames, getNodeName, getValue, hasMoreChildren, underlyingReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathTrackingReader

public PathTrackingReader(HierarchicalStreamReader reader,
                          PathTracker pathTracker)
Method Detail

moveDown

public void moveDown()
Description copied from interface: HierarchicalStreamReader
Select the current child as current node. A call to this function must be balanced with a call to HierarchicalStreamReader.moveUp().

Specified by:
moveDown in interface HierarchicalStreamReader
Overrides:
moveDown in class ReaderWrapper

moveUp

public void moveUp()
Description copied from interface: HierarchicalStreamReader
Select the parent node as current node.

Specified by:
moveUp in interface HierarchicalStreamReader
Overrides:
moveUp in class ReaderWrapper

appendErrors

public void appendErrors(ErrorWriter errorWriter)
Description copied from interface: HierarchicalStreamReader
If any errors are detected, allow the reader to add any additional information that can aid debugging (such as line numbers, XPath expressions, etc).

Specified by:
appendErrors in interface HierarchicalStreamReader
Overrides:
appendErrors in class ReaderWrapper


Joe Walnes, http://xstream.codehaus.org/