Class StaxReader
java.lang.Object
com.thoughtworks.xstream.io.AbstractReader
com.thoughtworks.xstream.io.xml.AbstractXmlReader
com.thoughtworks.xstream.io.xml.AbstractPullReader
com.thoughtworks.xstream.io.xml.StaxReader
- All Implemented Interfaces:
ErrorReporter, ExtendedHierarchicalStreamReader, HierarchicalStreamReader
-
Field Summary
FieldsFields inherited from class AbstractPullReader
COMMENT, END_NODE, OTHER, START_NODE, TEXT -
Constructor Summary
ConstructorsConstructorDescriptionStaxReader(QNameMap qnameMap, XMLStreamReader in) StaxReader(QNameMap qnameMap, XMLStreamReader in, NameCoder replacer) StaxReader(QNameMap qnameMap, XMLStreamReader in, 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.getAttribute(int index) Get the value of an attribute of the current node, by index.getAttribute(String name) Get the value of an attribute of the current node.intNumber of attributes in current node.getAttributeName(int index) Name of attribute in current node.protected StringPull the name of the current element from the stream.protected intPull the next event from the stream.protected StringpullText()Pull the contents of the current text node from the stream.Methods inherited from class AbstractPullReader
getAttributeNames, getNodeName, getValue, hasMoreChildren, mark, moveDown, moveUp, peekNextChild, resetMethods inherited from class AbstractXmlReader
escapeXmlName, unescapeXmlNameMethods inherited from class AbstractReader
decodeAttribute, decodeNode, encodeAttribute, encodeNode, underlyingReader
-
Field Details
-
qnameMap
-
in
-
-
Constructor Details
-
StaxReader
-
StaxReader
- Since:
- 1.4
-
StaxReader
Deprecated.As of 1.4 useStaxReader(QNameMap, XMLStreamReader, NameCoder)instead.- Since:
- 1.2
-
-
Method Details
-
pullNextEvent
protected int pullNextEvent()Description copied from class:AbstractPullReaderPull the next event from the stream.This MUST return
AbstractPullReader.START_NODE,AbstractPullReader.END_NODE,AbstractPullReader.TEXT,AbstractPullReader.COMMENT,AbstractPullReader.OTHERor throwStreamException.The underlying pull parser will most likely return its own event types. These must be mapped to the appropriate events.
- Specified by:
pullNextEventin classAbstractPullReader
-
pullElementName
Description copied from class:AbstractPullReaderPull the name of the current element from the stream.- Specified by:
pullElementNamein classAbstractPullReader
-
pullText
Description copied from class:AbstractPullReaderPull the contents of the current text node from the stream.- Specified by:
pullTextin classAbstractPullReader
-
getAttribute
Description copied from interface:HierarchicalStreamReaderGet the value of an attribute of the current node.If no such attribute exists, the method returns null.
-
getAttribute
Description copied from interface:HierarchicalStreamReaderGet the value of an attribute of the current node, by index.Note, the behavior of this method is dependent on the underlying parser when calling it with a non-existing index. Typically some kind of RuntimeException is thrown.
-
getAttributeCount
public int getAttributeCount()Description copied from interface:HierarchicalStreamReaderNumber of attributes in current node. -
getAttributeName
Description copied from interface:HierarchicalStreamReaderName of attribute in current node.Note, the behavior of this method is dependent on the underlying parser when calling it with a non-existing index. Typically some kind of RuntimeException is thrown.
-
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).- Parameters:
errorWriter- the error writer
-
close
public void close()Description copied from interface:HierarchicalStreamReaderClose the reader, if necessary.
-
StaxReader(QNameMap, XMLStreamReader, NameCoder)instead.