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, XomReader, XppDomReader
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDocumentReader(Object rootElement) protectedAbstractDocumentReader(Object rootElement, NameCoder nameCoder) protectedAbstractDocumentReader(Object rootElement, XmlFriendlyReplacer replacer) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidappendErrors(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).voidclose()Close the reader, if necessary.Iterator with the names of the attributes.protected abstract ObjectgetChild(int index) protected abstract intRetrieve the current processed node of the DOM.protected abstract ObjectbooleanDoes the node have any more children remaining that have not yet been read?voidmoveDown()Select the current child as current node.voidmoveUp()Select the parent node as current node.protected abstract voidreassignCurrentElement(Object current) Methods inherited from class AbstractXmlReader
escapeXmlName, unescapeXmlNameMethods inherited from class AbstractReader
decodeAttribute, decodeNode, encodeAttribute, encodeNode, peekNextChild, underlyingReaderMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HierarchicalStreamReader
getAttribute, getAttribute, getAttributeCount, getAttributeName, getNodeName, getValue, underlyingReader
-
Field Details
-
pointers
-
current
-
-
Constructor Details
-
AbstractDocumentReader
-
AbstractDocumentReader
-
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:HierarchicalStreamReaderDoes the node have any more children remaining that have not yet been read?- Specified by:
hasMoreChildrenin interfaceHierarchicalStreamReader
-
moveUp
public void moveUp()Description copied from interface:HierarchicalStreamReaderSelect the parent node as current node.- Specified by:
moveUpin interfaceHierarchicalStreamReader
-
moveDown
public void moveDown()Description copied from interface:HierarchicalStreamReaderSelect the current child as current node. A call to this function must be balanced with a call toHierarchicalStreamReader.moveUp().- Specified by:
moveDownin interfaceHierarchicalStreamReader
-
getAttributeNames
Description copied from interface:HierarchicalStreamReaderIterator 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:
getAttributeNamesin interfaceHierarchicalStreamReader
-
appendErrors
Description copied from interface:HierarchicalStreamReaderIf 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:
appendErrorsin interfaceErrorReporter- Specified by:
appendErrorsin interfaceHierarchicalStreamReader- Parameters:
errorWriter- the error writer
-
getCurrent
Description copied from interface:DocumentReaderRetrieve the current processed node of the DOM.- Specified by:
getCurrentin interfaceDocumentReader- Returns:
- the current node
-
close
public void close()Description copied from interface:HierarchicalStreamReaderClose the reader, if necessary.- Specified by:
closein interfaceHierarchicalStreamReader
-
AbstractDocumentReader(Object, NameCoder)instead.