|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thoughtworks.xstream.io.AbstractReader
com.thoughtworks.xstream.io.xml.AbstractXmlReader
com.thoughtworks.xstream.io.xml.AbstractPullReader
com.thoughtworks.xstream.io.xml.XppReader
public class XppReader
XStream reader that pulls directly from the stream using the XmlPullParser API.
Field Summary |
---|
Fields inherited from class com.thoughtworks.xstream.io.xml.AbstractPullReader |
---|
COMMENT, END_NODE, OTHER, START_NODE, TEXT |
Constructor Summary | |
---|---|
XppReader(Reader reader)
Deprecated. As of 1.4, use XppReader(Reader, XmlPullParser) instead |
|
XppReader(Reader reader,
XmlFriendlyReplacer replacer)
Deprecated. As of 1.4, use XppReader(Reader, XmlPullParser, NameCoder) instead |
|
XppReader(Reader reader,
org.xmlpull.v1.XmlPullParser parser)
Construct an XppReader. |
|
XppReader(Reader reader,
org.xmlpull.v1.XmlPullParser parser,
NameCoder nameCoder)
Construct an XppReader. |
Method Summary | |
---|---|
void |
appendErrors(ErrorWriter errorWriter)
Append context information to an ErrorWriter . |
void |
close()
Close the reader, if necessary. |
protected org.xmlpull.v1.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. |
Methods inherited from class com.thoughtworks.xstream.io.xml.AbstractPullReader |
---|
getAttributeNames, getNodeName, getValue, hasMoreChildren, mark, moveDown, moveUp, peekNextChild, reset |
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, underlyingReader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XppReader(Reader reader, org.xmlpull.v1.XmlPullParser parser)
reader
- the reader with the input dataparser
- the XPP parser to usepublic XppReader(Reader reader, org.xmlpull.v1.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)
instead
public XppReader(Reader reader, XmlFriendlyReplacer replacer)
XppReader(Reader, XmlPullParser, NameCoder)
instead
Method Detail |
---|
protected org.xmlpull.v1.XmlPullParser createParser()
XppReader(Reader, XmlPullParser)
instead
protected 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
public String getAttribute(int index)
HierarchicalStreamReader
public int getAttributeCount()
HierarchicalStreamReader
public String getAttributeName(int index)
HierarchicalStreamReader
public void appendErrors(ErrorWriter errorWriter)
ErrorReporter
ErrorWriter
.
errorWriter
- the error writerpublic void close()
HierarchicalStreamReader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |