public class XppReader extends AbstractPullReader
COMMENT, END_NODE, OTHER, START_NODE, TEXT
Constructor and Description |
---|
XppReader(Reader reader)
Deprecated.
As of 1.4, use
XppReader(Reader, XmlPullParser) instead |
XppReader(Reader reader,
XmlPullParser parser)
Construct an XppReader.
|
XppReader(Reader reader,
XmlPullParser parser,
NameCoder nameCoder)
Construct an XppReader.
|
Modifier and Type | Method and Description |
---|---|
void |
appendErrors(ErrorWriter errorWriter)
Append context information to an
ErrorWriter . |
void |
close()
Close the reader, if necessary.
|
protected XmlPullParser |
createParser()
Deprecated.
As of 1.4, use
XppReader(Reader, XmlPullParser) instead |
String |
getAttribute(int index)
Get the value of an attribute of the current node, by index.
|
String |
getAttribute(String name)
Get the value of an attribute of the current node.
|
int |
getAttributeCount()
Number of attributes in current node.
|
String |
getAttributeName(int index)
Name of attribute in current node.
|
protected String |
pullElementName()
Pull the name of the current element from the stream.
|
protected int |
pullNextEvent()
Pull the next event from the stream.
|
protected String |
pullText()
Pull the contents of the current text node from the stream.
|
getAttributeNames, getNodeName, getValue, hasMoreChildren, mark, moveDown, moveUp, peekNextChild, reset
escapeXmlName, unescapeXmlName
decodeAttribute, decodeNode, encodeAttribute, encodeNode, underlyingReader
public XppReader(Reader reader, XmlPullParser parser)
reader
- the reader with the input dataparser
- the XPP parser to usepublic XppReader(Reader reader, XmlPullParser parser, NameCoder nameCoder)
reader
- the reader with the input dataparser
- the XPP parser to usenameCoder
- the coder for XML friendly tag and attribute namespublic XppReader(Reader reader)
XppReader(Reader, XmlPullParser)
insteadprotected XmlPullParser createParser()
XppReader(Reader, XmlPullParser)
insteadprotected int pullNextEvent()
AbstractPullReader
This MUST return AbstractPullReader.START_NODE
, AbstractPullReader.END_NODE
, AbstractPullReader.TEXT
, AbstractPullReader.COMMENT
,
AbstractPullReader.OTHER
or throw StreamException
.
The underlying pull parser will most likely return its own event types. These must be mapped to the appropriate events.
pullNextEvent
in class AbstractPullReader
protected String pullElementName()
AbstractPullReader
pullElementName
in class AbstractPullReader
protected String pullText()
AbstractPullReader
pullText
in class AbstractPullReader
public String getAttribute(String name)
HierarchicalStreamReader
If no such attribute exists, the method returns null.
public String getAttribute(int index)
HierarchicalStreamReader
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.
public int getAttributeCount()
HierarchicalStreamReader
public String getAttributeName(int index)
HierarchicalStreamReader
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.
public void appendErrors(ErrorWriter errorWriter)
ErrorReporter
ErrorWriter
.errorWriter
- the error writerpublic void close()
HierarchicalStreamReader
Copyright © 2004–2017 XStream. All rights reserved.