Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.thoughtworks.xstream.io.xml
Class XppReader

    java.lang.Object
      com.thoughtworks.xstream.io.xml.AbstractXmlReader
          com.thoughtworks.xstream.io.xml.AbstractPullReader
              com.thoughtworks.xstream.io.xml.XppReader

All Implemented Interfaces:
  HierarchicalStreamReader, XmlFriendlyReader

    public class XppReader

extends AbstractPullReader

XStream reader that pulls directly from the stream using the XmlPullParser API.

Author:
  Joe Walnes

Field Summary

Fields inherited from class com.thoughtworks.xstream.io.xml.AbstractPullReader
`COMMENT, END_NODE, OTHER, START_NODE, TEXT`

Constructor Summary
`XppReader(Reader reader)`
`XppReader(Reader reader, XmlFriendlyReplacer replacer)`

Method Summary
`void` | `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.
`protected org.xmlpull.v1.XmlPullParser` | `createParser()` To use another implementation of org.xmlpull.v1.XmlPullParser, override this method.
`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, reset, underlyingReader`

Methods inherited from class com.thoughtworks.xstream.io.xml.AbstractXmlReader
`escapeXmlName, unescapeXmlName`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XppReader

    public XppReader(Reader reader)

### XppReader

    public XppReader(Reader reader,
                     XmlFriendlyReplacer replacer)

Since:
  1.2

Method Detail

### createParser

    protected org.xmlpull.v1.XmlPullParser createParser()

  To use another implementation of org.xmlpull.v1.XmlPullParser, override this method.

### pullNextEvent

    protected int pullNextEvent()

  Description copied from class: `AbstractPullReader`
  Pull the next event from the stream.

  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.

  Specified by:
    `pullNextEvent` in class `AbstractPullReader`

### pullElementName

    protected String pullElementName()

  Description copied from class: `AbstractPullReader`
  Pull the name of the current element from the stream.

  Specified by:
    `pullElementName` in class `AbstractPullReader`

### pullText

    protected String pullText()

  Description copied from class: `AbstractPullReader`
  Pull the contents of the current text node from the stream.

  Specified by:
    `pullText` in class `AbstractPullReader`

### getAttribute

    public String getAttribute(String name)

  Description copied from interface: `HierarchicalStreamReader`
  Get the value of an attribute of the current node.

### getAttribute

    public String getAttribute(int index)

  Description copied from interface: `HierarchicalStreamReader`
  Get the value of an attribute of the current node, by index.

### getAttributeCount

    public int getAttributeCount()

  Description copied from interface: `HierarchicalStreamReader`
  Number of attributes in current node.

### getAttributeName

    public String getAttributeName(int index)

  Description copied from interface: `HierarchicalStreamReader`
  Name of attribute in current node.

### appendErrors

    public void appendErrors(ErrorWriter errorWriter)

  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).

### close

    public void close()

  Description copied from interface: `HierarchicalStreamReader`
  Close the reader, if necessary.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 XStream. All Rights Reserved.