public class ResettableXmlEventReader extends ForwardingXmlEventReader
delegate
Constructor and Description |
---|
ResettableXmlEventReader(XMLEventReader delegate) |
Modifier and Type | Method and Description |
---|---|
int |
getCurrentEventPosition()
Returns an integer which represents the position of the current event in the event stream.
|
String |
getElementText() |
boolean |
hasNext() |
Object |
next() |
XMLEvent |
nextEvent() |
XMLEvent |
nextTag() |
XMLEvent |
peek() |
void |
remove() |
ResettableXmlEventReader |
reset()
Resets this reader back to its original state before any events have been consumed through methods like
nextEvent() or next() . |
void |
restoreEventPosition(int position)
Moves the pointer of this reader to the specified position.
|
String |
toString() |
close, getProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEachRemaining
public ResettableXmlEventReader(XMLEventReader delegate)
public ResettableXmlEventReader reset()
nextEvent()
or next()
.public XMLEvent nextEvent() throws XMLStreamException
nextEvent
in interface XMLEventReader
nextEvent
in class ForwardingXmlEventReader
XMLStreamException
public boolean hasNext()
hasNext
in interface Iterator
hasNext
in interface XMLEventReader
hasNext
in class ForwardingXmlEventReader
public XMLEvent peek() throws XMLStreamException
peek
in interface XMLEventReader
peek
in class ForwardingXmlEventReader
XMLStreamException
public int getCurrentEventPosition()
peek()
or nextEvent()
.public void restoreEventPosition(int position)
getCurrentEventPosition()
. This method is intended to allow clients
to move the pointer back to an earlier position in the stream.
Its not meant for fast forwarding - attempting to set a pointer higher than the number of events read from this reader will just result in stream will be served out as per normal.
position
- an integer representing the position of an event in an event streamIllegalArgumentException
- if pointer is less than zeropublic String getElementText() throws XMLStreamException
getElementText
in interface XMLEventReader
getElementText
in class ForwardingXmlEventReader
XMLStreamException
public XMLEvent nextTag() throws XMLStreamException
nextTag
in interface XMLEventReader
nextTag
in class ForwardingXmlEventReader
XMLStreamException
public Object next()
next
in interface Iterator
next
in class ForwardingXmlEventReader
public void remove()
remove
in interface Iterator
remove
in class ForwardingXmlEventReader
Copyright © 2003–2020 Atlassian. All rights reserved.