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.
|