public abstract class AbstractDocumentReader extends AbstractXmlReader implements DocumentReader
Modifier | Constructor and Description |
---|---|
protected |
AbstractDocumentReader(Object rootElement) |
protected |
AbstractDocumentReader(Object rootElement,
XmlFriendlyReplacer replacer) |
Modifier and Type | Method and 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 |
close()
Close the reader, if necessary.
|
Iterator |
getAttributeNames()
Names of attributes (as Strings).
|
protected abstract Object |
getChild(int index) |
protected abstract int |
getChildCount() |
Object |
getCurrent()
Retrieve the current processed node of the DOM.
|
protected abstract Object |
getParent() |
boolean |
hasMoreChildren()
Does the node have any more children remaining that have not yet been read?
|
void |
moveDown()
Select the current child as current node.
|
void |
moveUp()
Select the parent node as current node.
|
Object |
peekUnderlyingNode()
Deprecated.
As of 1.2, use
getCurrent() |
protected abstract void |
reassignCurrentElement(Object current) |
HierarchicalStreamReader |
underlyingReader()
Return the underlying HierarchicalStreamReader implementation.
|
unescapeXmlName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttribute, getAttribute, getAttributeCount, getAttributeName, getNodeName, getValue
protected AbstractDocumentReader(Object rootElement)
protected AbstractDocumentReader(Object rootElement, XmlFriendlyReplacer replacer)
protected abstract void reassignCurrentElement(Object current)
protected abstract Object getParent()
protected abstract Object getChild(int index)
protected abstract int getChildCount()
public boolean hasMoreChildren()
HierarchicalStreamReader
hasMoreChildren
in interface HierarchicalStreamReader
public void moveUp()
HierarchicalStreamReader
moveUp
in interface HierarchicalStreamReader
public void moveDown()
HierarchicalStreamReader
HierarchicalStreamReader.moveUp()
.moveDown
in interface HierarchicalStreamReader
public Iterator getAttributeNames()
HierarchicalStreamReader
getAttributeNames
in interface HierarchicalStreamReader
public void appendErrors(ErrorWriter errorWriter)
HierarchicalStreamReader
appendErrors
in interface HierarchicalStreamReader
public Object peekUnderlyingNode()
getCurrent()
public Object getCurrent()
DocumentReader
getCurrent
in interface DocumentReader
public void close()
HierarchicalStreamReader
close
in interface HierarchicalStreamReader
public HierarchicalStreamReader underlyingReader()
HierarchicalStreamReader
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.
underlyingReader
in interface HierarchicalStreamReader
Copyright © 2016 Internet2. All rights reserved.