public class BufferedXMLEventReader extends BaseXMLEventReader
Constructor and Description |
---|
BufferedXMLEventReader(XMLEventReader reader)
Create new buffering reader, no buffering is done until
mark(int) is called. |
BufferedXMLEventReader(XMLEventReader reader,
int eventLimit)
Create new buffering reader.
|
Modifier and Type | Method and Description |
---|---|
int |
bufferSize() |
void |
close() |
List<XMLEvent> |
getBuffer() |
boolean |
hasNext() |
protected XMLEvent |
internalNextEvent()
Subclass's version of
BaseXMLEventReader.nextEvent() , called by BaseXMLEventReader.next() |
void |
mark()
Same as calling
mark(int) with -1. |
void |
mark(int eventLimit)
Start buffering events
|
XMLEvent |
peek() |
void |
remove()
If reading from the buffer after a
reset() call an IllegalStateException will be thrown. |
void |
reset()
Reset the reader to these start of the buffered events.
|
getElementText, getPreviousEvent, next, nextEvent, nextTag
getParent, getProperty, setParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public BufferedXMLEventReader(XMLEventReader reader)
mark(int)
is called.public BufferedXMLEventReader(XMLEventReader reader, int eventLimit)
mark(int)
with the specified event limitmark(int)
protected XMLEvent internalNextEvent() throws XMLStreamException
BaseXMLEventReader
BaseXMLEventReader.nextEvent()
, called by BaseXMLEventReader.next()
internalNextEvent
in class BaseXMLEventReader
XMLStreamException
public boolean hasNext()
hasNext
in interface Iterator
hasNext
in interface XMLEventReader
hasNext
in class EventReaderDelegate
public XMLEvent peek() throws XMLStreamException
peek
in interface XMLEventReader
peek
in class EventReaderDelegate
XMLStreamException
public void mark()
mark(int)
with -1.public void mark(int eventLimit)
eventLimit
- the maximum number of events to buffer. -1 will buffer all events, 0 will buffer no events.public void reset()
public void close() throws XMLStreamException
close
in interface XMLEventReader
close
in class EventReaderDelegate
XMLStreamException
public int bufferSize()
public void remove()
reset()
call an IllegalStateException
will be thrown.remove
in interface Iterator
remove
in class EventReaderDelegate
Copyright © 2016 JBoss by Red Hat. All rights reserved.