public final class ReaderScanner extends XmlScanner
Reader. In general using this scanner is quite
a bit less optimal than that of 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[] |
_inputBuffer |
protected int |
_inputEnd |
protected int |
_inputPtr |
protected 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)
|
_attrCollector, _attrCount, _cfgCoalescing, _cfgLazyParsing, _config, _currElem, _currNsCount, _currRow, _currToken, _defaultNs, _depth, _entityPending, _isEmptyTag, _lastNsContext, _lastNsDecl, _nameBuffer, _nsBindingCache, _nsBindingCount, _nsBindings, _nsBindMisses, _pastBytesOrChars, _publicId, _rowStartOffset, _startColumn, _startRawOffset, _startRow, _systemId, _textBuilder, _tokenIncomplete, _tokenName, _xml11, CDATA_STR, INT_0, INT_9, INT_a, INT_A, INT_AMP, INT_APOS, INT_COLON, INT_CR, INT_EQ, INT_EXCL, INT_f, INT_F, INT_GT, INT_HYPHEN, INT_LBRACKET, INT_LF, INT_LT, INT_NULL, INT_QMARK, INT_QUOTE, INT_RBRACKET, INT_SLASH, INT_SPACE, INT_TAB, INT_z, MAX_UNICODE_CHAR, TOKEN_EOICHAR_CR, CHAR_LF, CHAR_NULL, CHAR_SPACE, STAX_DEFAULT_OUTPUT_ENCODING, STAX_DEFAULT_OUTPUT_VERSION, XML_DECL_KW_ENCODING, XML_DECL_KW_STANDALONE, XML_DECL_KW_VERSION, XML_SA_NO, XML_SA_YES, XML_V_10, XML_V_10_STR, XML_V_11, XML_V_11_STR, XML_V_UNKNOWNATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT| Constructor and Description |
|---|
ReaderScanner(ReaderConfig cfg,
Reader r) |
ReaderScanner(ReaderConfig cfg,
Reader r,
char[] buffer,
int ptr,
int last) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_closeSource() |
protected int |
_nextEntity()
Helper method used to isolate things that need to be (re)set in
cases where
|
protected void |
_releaseBuffers() |
protected PName |
addPName(char[] nameBuffer,
int nameLen,
int hash) |
protected int |
checkInTreeIndentation(char c)
Note: consequtive white space is only considered indentation,
if the following token seems like a tag (start/end).
|
protected int |
checkPrologIndentation(char c) |
protected void |
finishCData() |
protected void |
finishCharacters() |
protected void |
finishCoalescedCData() |
protected void |
finishCoalescedCharacters() |
protected 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 void |
finishComment() |
protected void |
finishDTD(boolean copyContents) |
protected void |
finishPI() |
protected void |
finishSpace() |
protected void |
finishToken()
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)
|
int |
getCurrentColumnNr() |
org.codehaus.stax2.XMLStreamLocation2 |
getCurrentLocation() |
long |
getEndingByteOffset() |
long |
getEndingCharOffset() |
long |
getStartingByteOffset() |
long |
getStartingCharOffset() |
protected int |
handleCharEntity() |
protected int |
handleCommentOrCdataStart() |
protected int |
handleEndElement() |
protected int |
handleEntityInText(boolean inAttr) |
protected int |
handlePIStart() |
protected int |
handlePrologDeclStart(boolean isProlog) |
protected int |
handleStartElement(char c) |
protected boolean |
loadAndRetain(int nrOfChars) |
protected boolean |
loadMore() |
protected char |
loadOne() |
protected char |
loadOne(int type) |
protected void |
markLF() |
protected void |
markLF(int offset) |
int |
nextFromProlog(boolean isProlog) |
int |
nextFromTree() |
protected PName |
parsePName(char c) |
protected String |
parsePublicId(char quoteChar) |
protected String |
parseSystemId(char quoteChar) |
protected void |
setStartLocation() |
protected void |
skipCData() |
protected boolean |
skipCharacters() |
protected boolean |
skipCoalescedText()
Method that gets called after a primary text segment (of type
CHARACTERS or CDATA, not applicable to SPACE) has been skipped.
|
protected void |
skipComment() |
protected char |
skipInternalWs(boolean reqd,
String msg) |
protected void |
skipPI() |
protected void |
skipSpace() |
bindName, bindNs, checkImmutableBinding, close, decodeAttrBinaryValue, decodeAttrValue, decodeAttrValues, decodeElements, findAttrIndex, findOrCreateBinding, fireSaxCharacterEvents, fireSaxCommentEvent, fireSaxEndElement, fireSaxPIEvent, fireSaxSpaceEvents, fireSaxStartElement, getAttrCollector, getAttrCount, getAttrLocalName, getAttrNsURI, getAttrPrefix, getAttrPrefixedName, getAttrQName, getAttrType, getAttrValue, getAttrValue, getConfig, getCurrentLineNr, getDepth, getDTDPublicId, getDTDSystemId, getEndLocation, getInputPublicId, getInputSystemId, getName, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getNamespaceURI, getNonTransientNamespaceContext, getNsCount, getPrefix, getPrefixes, getQName, getStartLocation, getText, getText, getTextCharacters, getTextCharacters, getTextLength, handleInvalidXmlChar, hasEmptyStack, isAttrSpecified, isEmptyTag, isTextWhitespace, loadMoreGuaranteed, loadMoreGuaranteed, reportDoubleHyphenInComments, reportDuplicateNsDecl, reportEntityOverflow, reportEofInName, reportIllegalCDataEnd, reportIllegalNsDecl, reportIllegalNsDecl, reportInputProblem, reportInvalidNameChar, reportInvalidNsIndex, reportInvalidXmlChar, reportMissingPISpace, reportMultipleColonsInName, reportPrologProblem, reportPrologUnexpChar, reportPrologUnexpElement, reportTreeUnexpChar, reportUnboundPrefix, reportUnexpandedEntityInAttr, reportUnexpectedEndTag, resetForDecoding, skipToken, throwInvalidSpace, throwNullChar, throwUnexpectedChar, verifyXmlCharprotected Reader _in
protected char[] _inputBuffer
protected int _inputPtr
protected int _inputEnd
protected int mTmpChar
protected final CharBasedPNameTable _symbols
public ReaderScanner(ReaderConfig cfg, Reader r, char[] buffer, int ptr, int last)
public ReaderScanner(ReaderConfig cfg, Reader r)
protected void _releaseBuffers()
_releaseBuffers in class XmlScannerprotected void _closeSource()
throws IOException
_closeSource in class XmlScannerIOExceptionprotected final void finishToken()
throws XMLStreamException
XmlScannerfinishToken in class XmlScannerXMLStreamExceptionpublic final int nextFromProlog(boolean isProlog)
throws XMLStreamException
nextFromProlog in class XmlScannerXMLStreamExceptionpublic final int nextFromTree()
throws XMLStreamException
nextFromTree in class XmlScannerXMLStreamExceptionprotected int _nextEntity()
protected final int handlePrologDeclStart(boolean isProlog)
throws XMLStreamException
XMLStreamExceptionprotected final int handleCommentOrCdataStart()
throws XMLStreamException
XMLStreamExceptionprotected final int handlePIStart()
throws XMLStreamException
XMLStreamExceptionprotected final int handleCharEntity()
throws XMLStreamException
XMLStreamExceptionprotected final int handleStartElement(char c)
throws XMLStreamException
XMLStreamExceptionprotected final int handleEndElement()
throws XMLStreamException
XMLStreamExceptionprotected final int handleEntityInText(boolean inAttr)
throws XMLStreamException
XMLStreamExceptionprotected final void finishComment()
throws XMLStreamException
finishComment in class XmlScannerXMLStreamExceptionprotected final void finishPI()
throws XMLStreamException
finishPI in class XmlScannerXMLStreamExceptionprotected final void finishDTD(boolean copyContents)
throws XMLStreamException
finishDTD in class XmlScannerXMLStreamExceptionprotected final void finishCData()
throws XMLStreamException
finishCData in class XmlScannerXMLStreamExceptionprotected final void finishCharacters()
throws XMLStreamException
finishCharacters in class XmlScannerXMLStreamExceptionprotected final void finishSpace()
throws XMLStreamException
finishSpace in class XmlScannerXMLStreamExceptionprotected final void finishCoalescedText()
throws XMLStreamException
XMLStreamExceptionprotected final void finishCoalescedCData()
throws XMLStreamException
XMLStreamExceptionprotected final void finishCoalescedCharacters()
throws XMLStreamException
XMLStreamExceptionprotected final boolean skipCoalescedText()
throws XMLStreamException
skipCoalescedText in class XmlScannerXMLStreamExceptionprotected final void skipComment()
throws XMLStreamException
skipComment in class XmlScannerXMLStreamExceptionprotected final void skipPI()
throws XMLStreamException
skipPI in class XmlScannerXMLStreamExceptionprotected final boolean skipCharacters()
throws XMLStreamException
skipCharacters in class XmlScannerXMLStreamExceptionprotected final void skipCData()
throws XMLStreamException
skipCData in class XmlScannerXMLStreamExceptionprotected final void skipSpace()
throws XMLStreamException
skipSpace in class XmlScannerXMLStreamExceptionprotected char skipInternalWs(boolean reqd,
String msg)
throws XMLStreamException
XMLStreamExceptionprotected 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.
XMLStreamExceptionprotected final int checkPrologIndentation(char c)
throws XMLStreamException
XMLStreamExceptionprotected PName parsePName(char c) throws XMLStreamException
XMLStreamExceptionprotected final PName addPName(char[] nameBuffer, int nameLen, int hash) throws XMLStreamException
XMLStreamExceptionprotected String parsePublicId(char quoteChar) throws XMLStreamException
XMLStreamExceptionprotected String parseSystemId(char quoteChar) throws XMLStreamException
XMLStreamExceptionpublic org.codehaus.stax2.XMLStreamLocation2 getCurrentLocation()
getCurrentLocation in class XmlScannerpublic int getCurrentColumnNr()
getCurrentColumnNr in class XmlScannerpublic long getStartingByteOffset()
getStartingByteOffset in class XmlScannerpublic long getStartingCharOffset()
getStartingCharOffset in class XmlScannerpublic long getEndingByteOffset()
throws XMLStreamException
getEndingByteOffset in class XmlScannerXMLStreamExceptionpublic long getEndingCharOffset()
throws XMLStreamException
getEndingCharOffset in class XmlScannerXMLStreamExceptionprotected final void markLF(int offset)
protected final void markLF()
protected final void setStartLocation()
protected final boolean loadMore()
throws XMLStreamException
loadMore in class XmlScannerXMLStreamExceptionprotected final char loadOne()
throws XMLStreamException
XMLStreamExceptionprotected final char loadOne(int type)
throws XMLStreamException
XMLStreamExceptionprotected final boolean loadAndRetain(int nrOfChars)
throws XMLStreamException
XMLStreamExceptionCopyright © 2019 FasterXML. All rights reserved.