public class XMLStreamReader extends XMLStreamEventsSync
XMLStreamReader: read-only, forward, event based.
The method next() allows to move forward to the next event (such as start element, end element, comment, text...).
It uses UnprotectedString to avoid allocating many character arrays.
Charset is automatically detected by reading the beginning of the XML (either with auto-detection or with the specified encoding).XMLStreamEvents.Attribute, XMLStreamEvents.ElementContext, XMLStreamEvents.Event, XMLStreamEvents.Starterevent, maxCDataSize, maxTextSize, stream| Constructor and Description |
|---|
XMLStreamReader(IO.Readable io,
Charset defaultEncoding,
int charactersBuffersSize,
int maxBuffers)
Initialize with the given IO.
|
XMLStreamReader(IO.Readable io,
int charactersBuffersSize,
int maxBuffers)
Constructor, without charset.
|
| Modifier and Type | Method and Description |
|---|---|
void |
next()
Move forward to the next event.
|
void |
start()
Start reading the XML to provide the first event.
|
static AsyncSupplier<XMLStreamReader,Exception> |
start(IO.Readable.Buffered io,
int charactersBufferSize,
int maxBuffers,
boolean addPositionInErrors)
Utility method that initialize a XMLStreamReader, initialize it, and
return an AsyncWork which is unblocked when characters are available to be read.
|
void |
startRootElement()
Shortcut to move forward to the first START_ELEMENT event, skipping the header or comments.
|
closeElement, goInto, nextInnerElement, nextInnerElement, nextStartElement, readInnerElementsText, readInnerText, searchElementgetAttributeByFullName, getAttributeByLocalName, getAttributeValueByFullName, getAttributeValueByLocalName, getAttributeValueWithNamespaceURI, getAttributeValueWithPrefix, getAttributeWithNamespaceURI, getAttributeWithPrefix, getCharacterStream, getMaximumCDataSize, getMaximumTextSize, getNamespaceURI, isNameChar, isNameStartChar, isSpaceChar, onStartElement, readNamespaces, removeAttributeByFullName, removeAttributeByLocalName, removeAttributeWithNamespaceURI, removeAttributeWithPrefix, reset, setMaximumCDataSize, setMaximumTextSizepublic XMLStreamReader(IO.Readable io, Charset defaultEncoding, int charactersBuffersSize, int maxBuffers)
PreBufferedReadable is created.
If the charset is null, it will be automatically detected.public XMLStreamReader(IO.Readable io, int charactersBuffersSize, int maxBuffers)
public static AsyncSupplier<XMLStreamReader,Exception> start(IO.Readable.Buffered io, int charactersBufferSize, int maxBuffers, boolean addPositionInErrors)
public void start()
throws XMLException,
IOException
XMLStreamEventsSyncstart in class XMLStreamEventsSyncXMLExceptionIOExceptionpublic void next()
throws XMLException,
IOException
next in class XMLStreamEventsSyncXMLExceptionIOExceptionpublic void startRootElement()
throws XMLException,
IOException
XMLExceptionIOExceptionCopyright © 2019. All rights reserved.