Top Description Inners Fields Constructors Methods
com.thoughtworks.xstream.io.xml

public abstract Class AbstractPullReader

extends AbstractXmlReader
Class Inheritance
Known Direct Subclasses
com.thoughtworks.xstream.io.xml.StaxReader, com.thoughtworks.xstream.io.xml.XppReader
Imports
java.util.Iterator, com.thoughtworks.xstream.core.util.FastStack, com.thoughtworks.xstream.io.AttributeNameIterator, com.thoughtworks.xstream.io.naming.NameCoder

Deprecated

as a consequence of AbstractXmlReader being deprecated. See corresponding docs for further information.

Base class that contains common functionality across HierarchicalStreamReader implementations that need to read from a pull parser.
Authors
Joe Walnes, James Strachan

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
protected static final int
private final FastStack
protected static final int
private final FastStack
private final FastStack
private boolean
protected static final int
private final FastStack
protected static final int
protected static final int

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public Iterator<E>
getAttributeNames()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttributeNames.

Iterator with the names of the attributes.
public String
public String
getValue()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getValue.

Get the value (text content) of the current node.
public boolean
hasMoreChildren()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.hasMoreChildren.

Does the node have any more children remaining that have not yet been read?
public void
mark()

private void
move()

public void
moveDown()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown.

Select the current child as current node.
public void
moveUp()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.moveUp.

Select the parent node as current node.
public String
protected abstract String
pullElementName()

Pull the name of the current element from the stream.

protected abstract int
pullNextEvent()

Pull the next event from the stream.

protected abstract String
pullText()

Pull the contents of the current text node from the stream.

private AbstractPullReader.Event
private AbstractPullReader.Event
public void
Inherited from com.thoughtworks.xstream.io.xml.AbstractXmlReader:
escapeXmlNameunescapeXmlName

Field Detail

COMMENTback to summary
protected static final int COMMENT
elementStackback to summary
private final FastStack elementStack
END_NODEback to summary
protected static final int END_NODE
lookaheadback to summary
private final FastStack lookahead
lookbackback to summary
private final FastStack lookback
markedback to summary
private boolean marked
OTHERback to summary
protected static final int OTHER
poolback to summary
private final FastStack pool
START_NODEback to summary
protected static final int START_NODE
TEXTback to summary
protected static final int TEXT

Constructor Detail

AbstractPullReaderback to summary
protected AbstractPullReader(NameCoder nameCoder)
Since
1.4
AbstractPullReaderback to summary
protected AbstractPullReader(XmlFriendlyReplacer replacer)

Deprecated

As of 1.4 use AbstractPullReader#AbstractPullReader(NameCoder) instead

Since
1.2

Method Detail

getAttributeNamesback to summary
public Iterator<E> getAttributeNames()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttributeNames.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.getAttributeNames.

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

getNodeNameback to summary
public String getNodeName()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getNodeName.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.getNodeName.

Get the name of the current node.

getValueback to summary
public String getValue()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.getValue.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.getValue.

Get the value (text content) of the current node.

hasMoreChildrenback to summary
public boolean hasMoreChildren()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.hasMoreChildren.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.hasMoreChildren.

Does the node have any more children remaining that have not yet been read?

markback to summary
public void mark()
moveback to summary
private void move()
moveDownback to summary
public void moveDown()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.moveDown.

Select the current child as current node. A call to this function must be balanced with a call to moveUp().

moveUpback to summary
public void moveUp()

Implements com.thoughtworks.xstream.io.HierarchicalStreamReader.moveUp.

Doc from com.thoughtworks.xstream.io.HierarchicalStreamReader.moveUp.

Select the parent node as current node.

peekNextChildback to summary
public String peekNextChild()

Overrides com.thoughtworks.xstream.io.AbstractReader.peekNextChild.

Implements com.thoughtworks.xstream.io.ExtendedHierarchicalStreamReader.peekNextChild.

Doc from com.thoughtworks.xstream.io.ExtendedHierarchicalStreamReader.peekNextChild.

Peek the name of the next child. In situation where hasMoreChildren() returns true, peek the tag name of the child.

pullElementNameback to summary
protected abstract String pullElementName()

Pull the name of the current element from the stream.

pullNextEventback to summary
protected abstract int pullNextEvent()

Pull the next event from the stream.

This MUST return START_NODE, END_NODE, TEXT, COMMENT, OTHER or throw com.thoughtworks.xstream.io.StreamException.

The underlying pull parser will most likely return its own event types. These must be mapped to the appropriate events.

pullTextback to summary
protected abstract String pullText()

Pull the contents of the current text node from the stream.

readEventback to summary
private AbstractPullReader.Event readEvent()
readRealEventback to summary
private AbstractPullReader.Event readRealEvent()
resetback to summary
public void reset()
com.thoughtworks.xstream.io.xml back to summary

private Class AbstractPullReader.Event

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

typeback to summary
pack-priv int type
valueback to summary
pack-priv String value

Constructor Detail

Eventback to summary
private Event()