java.io.Reader . In general using this scanner is quite
a bit less optimal than that of java.io.InputStream based
scanner. Nonetheless, it is included for completeness, since Stax
interface allows passing Readers as input sources.
| Modifier and Type | Field and Description |
|---|---|
| protected Reader | _in
Underlying InputStream to use for reading content. |
| protected char[] | |
| protected int | |
| protected int | |
| protected final CharBasedPNameTable | _symbols
For now, symbol table contains prefixed names. |
| protected int | mTmpChar
Storage location for a single character that can not be pushed back (for example, multi-byte char) |
| private static final XmlCharTypes | sCharTypes
Although java chars are basically UTF-16 in memory, the closest match for char types is Latin1. |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected int | |
| protected void | |
| protected final PName | |
| protected final int | Returns: -1, if indentation was handled; offset in the output buffer, if notNote consequtive white space is only considered indentation, if the following token seems like a tag (start/end). |
| protected final int | Returns: -1, if indentation was handled; offset in the output buffer, if not
|
| private char | checkSurrogate(char firstChar)
This method is called to verify that a surrogate pair found describes a legal surrogate pair (ie. |
| private int | |
| private int | collectValue(int attrPtr, char quoteChar, PName attrName)
This method implements the tight loop for parsing attribute values. |
| private int | decodeSurrogate(char firstChar)
This method is similar to |
| protected final void | |
| protected final void | |
| protected final void | |
| protected final void | |
| protected final void | finishCoalescedText()
Method that gets called after a primary text segment (of type CHARACTERS or CDATA, not applicable to SPACE) has been read in text buffer. |
| protected final void | |
| protected final void | |
| protected final void | |
| protected final void | |
| protected final void | finishToken()
Implements abstract com. |
| public int | |
| public XMLStreamLocation2 | |
| public long | |
| public long | |
| public long | |
| public long | |
| protected final int | |
| protected final int | |
| private final int | |
| protected final int | |
| protected final int | |
| private void | handleNsDeclaration(PName name, char quoteChar)
Method called from the main START_ELEMENT handling loop, to parse namespace URI values. |
| protected final int | |
| protected final int | |
| protected final int | |
| protected final boolean | |
| protected final boolean | |
| protected final char | |
| protected final char | |
| protected final void | |
| protected final void | |
| private final void | |
| public final int | nextFromProlog(boolean isProlog)
Implements abstract com. |
| public final int | |
| protected PName | |
| protected String | |
| protected String | |
| private void | |
| private void | |
| protected final void | |
| protected final void | |
| protected final boolean | |
| protected final boolean | Returns: True if we encountered an unexpandable entityImplements abstract com. |
| protected final void | |
| protected char | |
| protected final void | |
| protected final void |
| _in | back to summary |
|---|---|
| protected Reader _in Underlying InputStream to use for reading content. | |
| _inputBuffer | back to summary |
|---|---|
| protected char[] _inputBuffer | |
| _inputEnd | back to summary |
|---|---|
| protected int _inputEnd | |
| _inputPtr | back to summary |
|---|---|
| protected int _inputPtr | |
| _symbols | back to summary |
|---|---|
| protected final CharBasedPNameTable _symbols For now, symbol table contains prefixed names. In future it is possible that they may be split into prefixes and local names? | |
| mTmpChar | back to summary |
|---|---|
| protected int mTmpChar Storage location for a single character that can not be pushed back (for example, multi-byte char) | |
| sCharTypes | back to summary |
|---|---|
| private static final XmlCharTypes sCharTypes Although java chars are basically UTF-16 in memory, the closest match for char types is Latin1. | |
| ReaderScanner | back to summary |
|---|---|
| public ReaderScanner(ReaderConfig cfg, Reader r, char[] buffer, int ptr, int last) | |
| ReaderScanner | back to summary |
|---|---|
| public ReaderScanner(ReaderConfig cfg, Reader r) | |
| _closeSource | back to summary |
|---|---|
| protected void _closeSource() throws IOException Implements abstract com.
| |
| _nextEntity | back to summary |
|---|---|
| protected int _nextEntity() Helper method used to isolate things that need to be (re)set in cases where | |
| _releaseBuffers | back to summary |
|---|---|
| protected void _releaseBuffers() Overrides com.
| |
| addPName | back to summary |
|---|---|
| protected final PName addPName(char[] nameBuffer, int nameLen, int hash) throws XMLStreamException | |
| checkInTreeIndentation | back to summary |
|---|---|
| protected final int checkInTreeIndentation(char c) throws XMLStreamException Note consequtive white space is only considered indentation, if the following token seems like a tag (start/end). This so that if a CDATA section follows, it can be coalesced in coalescing mode. Although we could check if coalescing mode is enabled, this should seldom have significant effect either way, so it removes one possible source of problems in coalescing mode.
| |
| checkPrologIndentation | back to summary |
|---|---|
protected final int checkPrologIndentation(char c) throws XMLStreamException
| |
| checkSurrogate | back to summary |
|---|---|
| private char checkSurrogate(char firstChar) throws XMLStreamException This method is called to verify that a surrogate pair found describes a legal surrogate pair (ie. expands to a legal XML char) | |
| checkSurrogateNameChar | back to summary |
|---|---|
| private int checkSurrogateNameChar(char firstChar, char sec, int index) throws XMLStreamException | |
| collectValue | back to summary |
|---|---|
| private int collectValue(int attrPtr, char quoteChar, PName attrName) throws XMLStreamException This method implements the tight loop for parsing attribute values. It's off-lined from the main start element method to simplify main method, which makes code more maintainable and possibly easier for JIT/HotSpot to optimize. | |
| decodeSurrogate | back to summary |
|---|---|
| private int decodeSurrogate(char firstChar) throws XMLStreamException This method is similar to | |
| finishCData | back to summary |
|---|---|
| protected final void finishCData() throws XMLStreamException Implements abstract com.
| |
| finishCharacters | back to summary |
|---|---|
| protected final void finishCharacters() throws XMLStreamException Implements abstract com.
| |
| finishCoalescedCData | back to summary |
|---|---|
| protected final void finishCoalescedCData() throws XMLStreamException | |
| finishCoalescedCharacters | back to summary |
|---|---|
| protected final void finishCoalescedCharacters() throws XMLStreamException | |
| finishCoalescedText | back to summary |
|---|---|
| protected final void finishCoalescedText() throws XMLStreamException Method that gets called after a primary text segment (of type CHARACTERS or CDATA, not applicable to SPACE) has been read in text buffer. Method has to see if the following event would be textual as well, and if so, read it (and any other following textual segments). | |
| finishComment | back to summary |
|---|---|
| protected final void finishComment() throws XMLStreamException Implements abstract com.
| |
| finishDTD | back to summary |
|---|---|
| protected final void finishDTD(boolean copyContents) throws XMLStreamException Implements abstract com.
| |
| finishPI | back to summary |
|---|---|
| protected final void finishPI() throws XMLStreamException Implements abstract com.
| |
| finishSpace | back to summary |
|---|---|
| protected final void finishSpace() throws XMLStreamException Implements abstract com.
| |
| finishToken | back to summary |
|---|---|
| protected final void finishToken() throws XMLStreamException Implements abstract com. Doc from com. This method is called to ensure that the current token/event has been completely parsed, such that we have all the data needed to return it (textual content, PI data, comment text etc)
| |
| getCurrentColumnNr | back to summary |
|---|---|
| public int getCurrentColumnNr() Implements abstract com.
| |
| getCurrentLocation | back to summary |
|---|---|
| public XMLStreamLocation2 getCurrentLocation() Implements abstract com.
| |
| getEndingByteOffset | back to summary |
|---|---|
| public long getEndingByteOffset() throws XMLStreamException Implements abstract com.
| |
| getEndingCharOffset | back to summary |
|---|---|
| public long getEndingCharOffset() throws XMLStreamException Implements abstract com.
| |
| getStartingByteOffset | back to summary |
|---|---|
| public long getStartingByteOffset() Implements abstract com.
| |
| getStartingCharOffset | back to summary |
|---|---|
| public long getStartingCharOffset() Implements abstract com.
| |
| handleCharEntity | back to summary |
|---|---|
protected final int handleCharEntity() throws XMLStreamException
| |
| handleCommentOrCdataStart | back to summary |
|---|---|
| protected final int handleCommentOrCdataStart() throws XMLStreamException | |
| handleDtdStart | back to summary |
|---|---|
| private final int handleDtdStart() throws XMLStreamException | |
| handleEndElement | back to summary |
|---|---|
| protected final int handleEndElement() throws XMLStreamException | |
| handleEntityInText | back to summary |
|---|---|
| protected final int handleEntityInText(boolean inAttr) throws XMLStreamException | |
| handleNsDeclaration | back to summary |
|---|---|
| private void handleNsDeclaration(PName name, char quoteChar) throws XMLStreamException Method called from the main START_ELEMENT handling loop, to parse namespace URI values. | |
| handlePIStart | back to summary |
|---|---|
| protected final int handlePIStart() throws XMLStreamException | |
| handlePrologDeclStart | back to summary |
|---|---|
| protected final int handlePrologDeclStart(boolean isProlog) throws XMLStreamException | |
| handleStartElement | back to summary |
|---|---|
| protected final int handleStartElement(char c) throws XMLStreamException | |
| loadAndRetain | back to summary |
|---|---|
| protected final boolean loadAndRetain(int nrOfChars) throws XMLStreamException | |
| loadMore | back to summary |
|---|---|
| protected final boolean loadMore() throws XMLStreamException Implements abstract com.
| |
| loadOne | back to summary |
|---|---|
| protected final char loadOne() throws XMLStreamException | |
| loadOne | back to summary |
|---|---|
| protected final char loadOne(int type) throws XMLStreamException | |
| markLF | back to summary |
|---|---|
| protected final void markLF(int offset) | |
| markLF | back to summary |
|---|---|
| protected final void markLF() | |
| matchAsciiKeyword | back to summary |
|---|---|
| private final void matchAsciiKeyword(String keyw) throws XMLStreamException | |
| nextFromProlog | back to summary |
|---|---|
| public final int nextFromProlog(boolean isProlog) throws XMLStreamException Implements abstract com.
| |
| nextFromTree | back to summary |
|---|---|
| public final int nextFromTree() throws XMLStreamException Implements abstract com.
| |
| parsePName | back to summary |
|---|---|
| protected PName parsePName(char c) throws XMLStreamException | |
| parsePublicId | back to summary |
|---|---|
| protected String parsePublicId(char quoteChar) throws XMLStreamException | |
| parseSystemId | back to summary |
|---|---|
| protected String parseSystemId(char quoteChar) throws XMLStreamException | |
| reportInvalidFirstSurrogate | back to summary |
|---|---|
| private void reportInvalidFirstSurrogate(char ch) throws XMLStreamException | |
| reportInvalidSecondSurrogate | back to summary |
|---|---|
| private void reportInvalidSecondSurrogate(char ch) throws XMLStreamException | |
| setStartLocation | back to summary |
|---|---|
| protected final void setStartLocation() | |
| skipCData | back to summary |
|---|---|
| protected final void skipCData() throws XMLStreamException Implements abstract com.
| |
| skipCharacters | back to summary |
|---|---|
| protected final boolean skipCharacters() throws XMLStreamException Implements abstract com.
| |
| skipCoalescedText | back to summary |
|---|---|
| protected final boolean skipCoalescedText() throws XMLStreamException Implements abstract com. Method that gets called after a primary text segment (of type CHARACTERS or CDATA, not applicable to SPACE) has been skipped. Method has to see if the following event would be textual as well, and if so, skip it (and any other following textual segments).
| |
| skipComment | back to summary |
|---|---|
| protected final void skipComment() throws XMLStreamException Implements abstract com.
| |
| skipInternalWs | back to summary |
|---|---|
protected char skipInternalWs(boolean reqd, String msg) throws XMLStreamException
| |
| skipPI | back to summary |
|---|---|
| protected final void skipPI() throws XMLStreamException Implements abstract com.
| |
| skipSpace | back to summary |
|---|---|
| protected final void skipSpace() throws XMLStreamException Implements abstract com.
| |