public class XMLEventReaderBase
extends java.lang.Object
implements javax.xml.stream.XMLEventReader, javax.xml.stream.util.XMLEventConsumer
The base reader class.
| Modifier and Type | Field and Description |
|---|---|
protected javax.xml.stream.util.XMLEventAllocator |
allocator |
protected javax.xml.stream.XMLStreamReader |
reader |
| Constructor and Description |
|---|
XMLEventReaderBase(javax.xml.stream.XMLStreamReader reader) |
XMLEventReaderBase(javax.xml.stream.XMLStreamReader reader,
javax.xml.stream.util.XMLEventAllocator alloc) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(javax.xml.stream.events.XMLEvent event)
This method adds an event to the consumer.
|
void |
close()
Frees any resources associated with this Reader.
|
protected javax.xml.stream.events.XMLEvent |
get() |
java.lang.String |
getElementText()
Reads the content of a text-only element.
|
java.lang.Object |
getProperty(java.lang.String name)
Get the value of a feature/property from the underlying implementation
|
boolean |
hasNext()
Check if there are more events.
|
protected void |
internal_close() |
protected boolean |
isOpen() |
static void |
main(java.lang.String[] args) |
protected boolean |
needsMore() |
java.lang.Object |
next() |
javax.xml.stream.events.XMLEvent |
nextEvent()
Get the next XMLEvent
|
javax.xml.stream.events.XMLEvent |
nextTag()
Skips any insignificant space events until a START_ELEMENT or
END_ELEMENT is reached.
|
protected boolean |
parseSome() |
javax.xml.stream.events.XMLEvent |
peek()
Check the next XMLEvent without reading it from the stream.
|
void |
remove() |
void |
setAllocator(javax.xml.stream.util.XMLEventAllocator allocator) |
void |
setConfigurationContext(ConfigurationContextBase base) |
protected javax.xml.stream.XMLStreamReader reader
protected javax.xml.stream.util.XMLEventAllocator allocator
public XMLEventReaderBase(javax.xml.stream.XMLStreamReader reader)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic XMLEventReaderBase(javax.xml.stream.XMLStreamReader reader,
javax.xml.stream.util.XMLEventAllocator alloc)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void setAllocator(javax.xml.stream.util.XMLEventAllocator allocator)
public java.lang.String getElementText()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLEventReadergetElementText in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamException - if the current event is not a START_ELEMENT
or if a non text element is encounteredpublic javax.xml.stream.events.XMLEvent nextTag()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLEventReadernextTag in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamException - if anything other than space characters are encounteredpublic java.lang.Object next()
next in interface java.util.Iteratorpublic javax.xml.stream.events.XMLEvent nextEvent()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLEventReadernextEvent in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamException - if there is an error with the underlying XML.XMLEventpublic boolean hasNext()
javax.xml.stream.XMLEventReaderhasNext in interface java.util.IteratorhasNext in interface javax.xml.stream.XMLEventReaderpublic javax.xml.stream.events.XMLEvent peek()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLEventReaderpeek in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamExceptionXMLEventpublic void add(javax.xml.stream.events.XMLEvent event)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.util.XMLEventConsumeradd in interface javax.xml.stream.util.XMLEventConsumerevent - the event to add, may not be nulljavax.xml.stream.XMLStreamExceptionprotected boolean needsMore()
protected javax.xml.stream.events.XMLEvent get()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionprotected boolean isOpen()
protected void internal_close()
public void close()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLEventReaderclose in interface javax.xml.stream.XMLEventReaderjavax.xml.stream.XMLStreamException - if there are errors freeing associated resourcesprotected boolean parseSome()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic void setConfigurationContext(ConfigurationContextBase base)
public java.lang.Object getProperty(java.lang.String name)
javax.xml.stream.XMLEventReadergetProperty in interface javax.xml.stream.XMLEventReadername - The name of the propertypublic void remove()
remove in interface java.util.Iteratorpublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception