Package com.thoughtworks.xstream.io.path
Class PathTrackingReader
- java.lang.Object
-
- com.thoughtworks.xstream.io.ReaderWrapper
-
- com.thoughtworks.xstream.io.path.PathTrackingReader
-
- All Implemented Interfaces:
ErrorReporter
,ExtendedHierarchicalStreamReader
,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.- See Also:
PathTracker
,Path
-
-
Field Summary
Fields Modifier and Type Field Description private PathTracker
pathTracker
-
Fields inherited from class com.thoughtworks.xstream.io.ReaderWrapper
wrapped
-
-
Constructor Summary
Constructors Constructor Description PathTrackingReader(HierarchicalStreamReader reader, PathTracker pathTracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, peekNextChild, underlyingReader
-
-
-
-
Field Detail
-
pathTracker
private final PathTracker pathTracker
-
-
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 toHierarchicalStreamReader.moveUp()
.- Specified by:
moveDown
in interfaceHierarchicalStreamReader
- Overrides:
moveDown
in classReaderWrapper
-
moveUp
public void moveUp()
Description copied from interface:HierarchicalStreamReader
Select the parent node as current node.- Specified by:
moveUp
in interfaceHierarchicalStreamReader
- Overrides:
moveUp
in classReaderWrapper
-
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 interfaceErrorReporter
- Specified by:
appendErrors
in interfaceHierarchicalStreamReader
- Overrides:
appendErrors
in classReaderWrapper
- Parameters:
errorWriter
- the error writer
-
-