Package com.thoughtworks.xstream.io.xml
Class AbstractDocumentReader
java.lang.Object
com.thoughtworks.xstream.io.AbstractReader
com.thoughtworks.xstream.io.xml.AbstractXmlReader
com.thoughtworks.xstream.io.xml.AbstractDocumentReader
- All Implemented Interfaces:
ErrorReporter
,ExtendedHierarchicalStreamReader
,HierarchicalStreamReader
,DocumentReader
- Direct Known Subclasses:
Dom4JReader
,DomReader
,JDom2Reader
,JDomReader
,XppDomReader
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractDocumentReader
(Object rootElement) protected
AbstractDocumentReader
(Object rootElement, NameCoder nameCoder) protected
AbstractDocumentReader
(Object rootElement, XmlFriendlyReplacer replacer) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 with the names of the attributes.protected abstract Object
getChild
(int index) protected abstract int
Retrieve the current processed node of the DOM.protected abstract Object
boolean
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.protected abstract void
reassignCurrentElement
(Object current) Methods inherited from class com.thoughtworks.xstream.io.xml.AbstractXmlReader
escapeXmlName, unescapeXmlName
Methods inherited from class com.thoughtworks.xstream.io.AbstractReader
decodeAttribute, decodeNode, encodeAttribute, encodeNode, peekNextChild, underlyingReader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.thoughtworks.xstream.io.HierarchicalStreamReader
getAttribute, getAttribute, getAttributeCount, getAttributeName, getNodeName, getValue, underlyingReader
-
Field Details
-
pointers
-
current
-
-
Constructor Details
-
AbstractDocumentReader
-
AbstractDocumentReader
- Since:
- 1.4
-
AbstractDocumentReader
Deprecated.As of 1.4, useAbstractDocumentReader(Object, NameCoder)
instead.- Since:
- 1.2
-
-
Method Details
-
reassignCurrentElement
-
getParent
-
getChild
-
getChildCount
protected abstract int getChildCount() -
hasMoreChildren
public boolean hasMoreChildren()Description copied from interface:HierarchicalStreamReader
Does the node have any more children remaining that have not yet been read?- Specified by:
hasMoreChildren
in interfaceHierarchicalStreamReader
-
moveUp
public void moveUp()Description copied from interface:HierarchicalStreamReader
Select the parent node as current node.- Specified by:
moveUp
in interfaceHierarchicalStreamReader
-
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
-
getAttributeNames
Description copied from interface:HierarchicalStreamReader
Iterator with the names of the attributes.Note, the iterator is only valid as long as the internal state of the underlying parser is still at the start of the current element. The behavior is undefined if the parser moved on.
- Specified by:
getAttributeNames
in interfaceHierarchicalStreamReader
-
appendErrors
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
- Parameters:
errorWriter
- the error writer
-
getCurrent
Description copied from interface:DocumentReader
Retrieve the current processed node of the DOM.- Specified by:
getCurrent
in interfaceDocumentReader
- Returns:
- the current node
-
close
public void close()Description copied from interface:HierarchicalStreamReader
Close the reader, if necessary.- Specified by:
close
in interfaceHierarchicalStreamReader
-
AbstractDocumentReader(Object, NameCoder)
instead.