|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.fasterxml.aalto.in.XmlScanner
com.fasterxml.aalto.in.ReaderScanner
public final class ReaderScanner
This is the concrete scanner implementation used when input comes
as a 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.
| Field Summary | |
|---|---|
protected char[] |
_inputBuffer
|
protected int |
_inputEnd
|
protected int |
_inputPtr
|
protected int |
mPastChars
Number of bytes that were read and processed before the contents of the current buffer; used for calculating absolute offsets. |
protected int |
mRowStartOffset
Offset used to calculate the column value given current input buffer pointer. |
protected int |
mTmpChar
Storage location for a single character that can not be pushed back (for example, multi-byte char) |
| Fields inherited from class com.fasterxml.aalto.in.XmlScanner |
|---|
_attrCollector, _attrCount, _cfgCoalescing, _cfgLazyParsing, _config, _currElem, _currNsCount, _currRow, _currToken, _defaultNs, _depth, _entityPending, _isEmptyTag, _lastNsContext, _lastNsDecl, _nameBuffer, _publicId, _systemId, _textBuilder, _tokenIncomplete, _tokenName, _xml11, CDATA_STR, INT_A, INT_AMP, INT_APOS, INT_COLON, INT_CR, INT_EQ, INT_EXCL, INT_GT, INT_HYPHEN, INT_LBRACKET, INT_LF, INT_LT, INT_NULL, INT_QMARK, INT_QUOTE, INT_RBRACKET, INT_SLASH, INT_SPACE, INT_TAB, MAX_UNICODE_CHAR, TOKEN_EOI |
| Fields inherited from interface com.fasterxml.aalto.XmlConsts |
|---|
CHAR_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_UNKNOWN |
| Fields inherited from interface javax.xml.stream.XMLStreamConstants |
|---|
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
| Constructor Summary | |
|---|---|
ReaderScanner(ReaderConfig cfg,
java.io.Reader r)
|
|
ReaderScanner(ReaderConfig cfg,
java.io.Reader r,
char[] buffer,
int ptr,
int last)
|
|
| Method Summary | |
|---|---|
protected void |
_closeSource()
|
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()
|
int |
getCurrentColumnNr()
|
int |
getCurrentLineNr()
|
org.codehaus.stax2.XMLStreamLocation2 |
getCurrentLocation()
|
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 java.lang.String |
parsePublicId(char quoteChar)
|
protected java.lang.String |
parseSystemId(char quoteChar)
|
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,
java.lang.String msg)
|
protected void |
skipPI()
|
protected void |
skipSpace()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected char[] _inputBuffer
protected int _inputPtr
protected int _inputEnd
protected int mTmpChar
protected int mPastChars
protected int mRowStartOffset
| Constructor Detail |
|---|
public ReaderScanner(ReaderConfig cfg,
java.io.Reader r,
char[] buffer,
int ptr,
int last)
public ReaderScanner(ReaderConfig cfg,
java.io.Reader r)
| Method Detail |
|---|
protected void _releaseBuffers()
_releaseBuffers in class XmlScanner
protected void _closeSource()
throws java.io.IOException
_closeSource in class XmlScannerjava.io.IOException
public final int nextFromProlog(boolean isProlog)
throws javax.xml.stream.XMLStreamException
nextFromProlog in class XmlScannerjavax.xml.stream.XMLStreamException
public final int nextFromTree()
throws javax.xml.stream.XMLStreamException
nextFromTree in class XmlScannerjavax.xml.stream.XMLStreamException
protected final int handlePrologDeclStart(boolean isProlog)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final int handleCommentOrCdataStart()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final int handlePIStart()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final int handleCharEntity()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final int handleStartElement(char c)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final int handleEndElement()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final int handleEntityInText(boolean inAttr)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final void finishComment()
throws javax.xml.stream.XMLStreamException
finishComment in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void finishPI()
throws javax.xml.stream.XMLStreamException
finishPI in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void finishDTD(boolean copyContents)
throws javax.xml.stream.XMLStreamException
finishDTD in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void finishCData()
throws javax.xml.stream.XMLStreamException
finishCData in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void finishCharacters()
throws javax.xml.stream.XMLStreamException
finishCharacters in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void finishSpace()
throws javax.xml.stream.XMLStreamException
finishSpace in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void finishCoalescedText()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final void finishCoalescedCData()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final void finishCoalescedCharacters()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final boolean skipCoalescedText()
throws javax.xml.stream.XMLStreamException
skipCoalescedText in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void skipComment()
throws javax.xml.stream.XMLStreamException
skipComment in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void skipPI()
throws javax.xml.stream.XMLStreamException
skipPI in class XmlScannerjavax.xml.stream.XMLStreamException
protected final boolean skipCharacters()
throws javax.xml.stream.XMLStreamException
skipCharacters in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void skipCData()
throws javax.xml.stream.XMLStreamException
skipCData in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void skipSpace()
throws javax.xml.stream.XMLStreamException
skipSpace in class XmlScannerjavax.xml.stream.XMLStreamException
protected char skipInternalWs(boolean reqd,
java.lang.String msg)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final int checkInTreeIndentation(char c)
throws javax.xml.stream.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.
javax.xml.stream.XMLStreamException
protected final int checkPrologIndentation(char c)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected PName parsePName(char c)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final PName addPName(char[] nameBuffer,
int nameLen,
int hash)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected java.lang.String parsePublicId(char quoteChar)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected java.lang.String parseSystemId(char quoteChar)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic org.codehaus.stax2.XMLStreamLocation2 getCurrentLocation()
getCurrentLocation in class XmlScannerpublic int getCurrentLineNr()
getCurrentLineNr in class XmlScannerpublic int getCurrentColumnNr()
getCurrentColumnNr in class XmlScannerprotected final void markLF(int offset)
protected final void markLF()
protected final boolean loadMore()
throws javax.xml.stream.XMLStreamException
loadMore in class XmlScannerjavax.xml.stream.XMLStreamException
protected final char loadOne()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final char loadOne(int type)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final boolean loadAndRetain(int nrOfChars)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||