Top Description Classes
[default module]

Package com.thoughtworks.xstream.io.path


Library for tracking paths of nodes in documents using a subset of XPath. This subset of XPath is just enough for XStream to be able to use XPath expressions to represent references across the object graph, while still remaining very quick.

The Path class represents a path to a single node in the tree. Two absolute paths can also be compared to calculate the relative path between them. A relative path can be applied to an absolute path to calculate another absolute path.

A PathTracker can be linked to a HierarchicalStreamWriter or HierarchicalStreamReader and expose the path of wherever the node is currently positioned. This is done by wrapping the HierarchicalStreamWriter/HierarchicalStreamReader instances with a PathTrackingWriter or PathTrackingReader.

Note that the paths produced are XPath compliant, so can be read by other XPath engines. The following are examples of path expressions that the Path object supports:

Class Summary

Modifier and TypeClass and Description
public class
Path

Represents a path to a single node in the tree.

public class
PathTracker

Maintains the current Path as a stream is moved through.

public class
PathTrackingReader

Deprecated as a consequence of ReaderWrapper being deprecated.
Wrapper for HierarchicalStreamReader that tracks the path (a subset of XPath) of the current node that is being read.
public class
PathTrackingWriter

Deprecated as a consequence of WriterWrapper being deprecated.
Wrapper for HierarchicalStreamWriter that tracks the path (a subset of XPath) of the current node that is being written.