|
||||||||||
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.ByteBasedScanner
com.fasterxml.aalto.async.AsyncByteScanner
com.fasterxml.aalto.async.AsyncUtfScanner
public class AsyncUtfScanner
This class handles parsing of UTF-8 encoded XML streams, as well as other UTF-8 compatible (subset) encodings (specifically, Latin1 and US-ASCII).
Field Summary | |
---|---|
protected boolean |
_inDtdDeclaration
Flag that indicates whether we are inside a declaration during parsing of internal DTD subset. |
Fields inherited from class com.fasterxml.aalto.async.AsyncByteScanner |
---|
_currQuad, _currQuadBytes, _elemAllNsBound, _elemAttrCount, _elemAttrName, _elemAttrPtr, _elemAttrQuote, _elemNsPtr, _endOfInput, _entityValue, _inputBuffer, _nextEvent, _origBufferLen, _pendingInput, _quadCount, _state, _surroundingEvent |
Fields inherited from class com.fasterxml.aalto.in.ByteBasedScanner |
---|
_charTypes, _inputEnd, _inputPtr, _pastBytes, _quadBuffer, _rowStartOffset, _symbols, _tmpChar, BYTE_a, BYTE_A, BYTE_AMP, BYTE_APOS, BYTE_C, BYTE_CR, BYTE_D, BYTE_EQ, BYTE_EXCL, BYTE_g, BYTE_GT, BYTE_HASH, BYTE_HYPHEN, BYTE_l, BYTE_LBRACKET, BYTE_LF, BYTE_LT, BYTE_m, BYTE_NULL, BYTE_o, BYTE_p, BYTE_P, BYTE_q, BYTE_QMARK, BYTE_QUOT, BYTE_RBRACKET, BYTE_s, BYTE_S, BYTE_SEMICOLON, BYTE_SLASH, BYTE_SPACE, BYTE_t, BYTE_T, BYTE_TAB, BYTE_u, BYTE_x |
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, _nsBindingCache, _nsBindingCount, _nsBindings, _nsBindMisses, _publicId, _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_EOI |
Fields inherited from interface com.fasterxml.aalto.util.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 | |
---|---|
AsyncUtfScanner(ReaderConfig cfg)
|
Method Summary | |
---|---|
protected PName |
addPName(int hash,
int[] quads,
int qlen,
int lastQuadBytes)
|
protected int |
decodeUtf8_2(int c)
Note: caller must guarantee enough data is available before calling the method |
protected int |
decodeUtf8_3(int c1)
Note: caller must guarantee enough data is available before calling the method |
protected int |
decodeUtf8_3(int c1,
int c2,
int c3)
|
protected int |
decodeUtf8_4(int c)
|
protected int |
decodeUtf8_4(int c1,
int c2,
int c3,
int c4)
|
protected void |
finishCharacters()
This method only gets called in non-coalescing mode; and if so, needs to parse as many characters of the current text segment from the current input block as possible. |
protected int |
finishCharactersCoalescing()
|
protected boolean |
handleAttrValue()
|
protected int |
handleCDataPending()
|
protected int |
handleCommentPending()
|
protected int |
handleDecEntityInCharacters(int ptr)
|
protected boolean |
handleDTDInternalSubset(boolean init)
|
protected int |
handleEntityInAttributeValue()
Method called to handle entity encountered inside attribute value. |
protected int |
handleEntityInCharacters()
Method called to handle entity encountered inside CHARACTERS segment, when trying to complete a non-coalescing text segment. |
protected int |
handleHexEntityInCharacters(int ptr)
|
protected boolean |
handleNsDecl()
|
protected int |
handlePIPending()
|
protected int |
parseCDataContents()
|
protected int |
parseCommentContents()
|
protected int |
parsePIData()
|
protected void |
reportInvalidInitial(int mask)
|
protected void |
reportInvalidOther(int mask)
|
protected void |
reportInvalidOther(int mask,
int ptr)
|
protected boolean |
skipCharacters()
Method that will be called to skip all possible characters from the input buffer, but without blocking. |
protected boolean |
skipCoalescedText()
Coalescing mode is (and will) not be implemented for non-blocking parsers, so this method should never get called. |
protected void |
skipUtf8_2(int c)
|
protected int |
startCharacters(byte b)
Method called to initialize state for CHARACTERS event, after just a single byte has been seen. |
protected int |
startCharactersPending()
This method gets called, if the first character of a CHARACTERS event could not be fully read (multi-byte, split over buffer boundary). |
Methods inherited from class com.fasterxml.aalto.in.ByteBasedScanner |
---|
_releaseBuffers, addUtfPName, getCurrentColumnNr, getCurrentLineNr, getCurrentLocation, markLF, markLF |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean _inDtdDeclaration
Constructor Detail |
---|
public AsyncUtfScanner(ReaderConfig cfg)
Method Detail |
---|
protected final int startCharacters(byte b) throws XMLStreamException
AsyncByteScanner
XMLStreamReader.next()
returns, no
blocking can occur when calling other methods.
startCharacters
in class AsyncByteScanner
XMLStreamException
protected int startCharactersPending() throws XMLStreamException
AsyncByteScanner
startCharactersPending
in class AsyncByteScanner
XMLStreamException
protected final void finishCharacters() throws XMLStreamException
finishCharacters
in class AsyncByteScanner
XMLStreamException
protected final int finishCharactersCoalescing() throws XMLStreamException
finishCharactersCoalescing
in class AsyncByteScanner
XMLStreamException
protected int handleEntityInCharacters() throws XMLStreamException
NOTE: unlike with generic parsing of named entities, where trailing semicolon needs to be left in place, here we should just process it right away.
XMLStreamException
protected int handleDecEntityInCharacters(int ptr) throws XMLStreamException
XMLStreamException
protected int handleHexEntityInCharacters(int ptr) throws XMLStreamException
XMLStreamException
protected boolean skipCharacters() throws XMLStreamException
skipCharacters
in class AsyncByteScanner
XMLStreamException
protected boolean skipCoalescedText() throws XMLStreamException
skipCoalescedText
in class XmlScanner
XMLStreamException
protected boolean handleAttrValue() throws XMLStreamException
handleAttrValue
in class AsyncByteScanner
XMLStreamException
protected int handleEntityInAttributeValue() throws XMLStreamException
XMLStreamException
protected boolean handleNsDecl() throws XMLStreamException
handleNsDecl
in class AsyncByteScanner
XMLStreamException
protected final boolean handleDTDInternalSubset(boolean init) throws XMLStreamException
handleDTDInternalSubset
in class AsyncByteScanner
init
- Whether this is the first call (and state needs to be initialized) or not
XMLStreamException
protected final int parseCommentContents() throws XMLStreamException
parseCommentContents
in class AsyncByteScanner
XMLStreamException
protected final int handleCommentPending() throws XMLStreamException
XMLStreamException
protected final int parseCDataContents() throws XMLStreamException
parseCDataContents
in class AsyncByteScanner
XMLStreamException
protected final int handleCDataPending() throws XMLStreamException
XMLStreamException
protected final int parsePIData() throws XMLStreamException
parsePIData
in class AsyncByteScanner
XMLStreamException
protected final int handlePIPending() throws XMLStreamException
XMLStreamException
protected final int decodeUtf8_2(int c) throws XMLStreamException
Note: caller must guarantee enough data is available before calling the method
XMLStreamException
protected final void skipUtf8_2(int c) throws XMLStreamException
XMLStreamException
protected final int decodeUtf8_3(int c1) throws XMLStreamException
Note: caller must guarantee enough data is available before calling the method
XMLStreamException
protected final int decodeUtf8_3(int c1, int c2, int c3) throws XMLStreamException
XMLStreamException
protected final int decodeUtf8_4(int c) throws XMLStreamException
XMLStreamException
protected final int decodeUtf8_4(int c1, int c2, int c3, int c4) throws XMLStreamException
XMLStreamException
protected final PName addPName(int hash, int[] quads, int qlen, int lastQuadBytes) throws XMLStreamException
addPName
in class AsyncByteScanner
XMLStreamException
protected void reportInvalidInitial(int mask) throws XMLStreamException
reportInvalidInitial
in class ByteBasedScanner
XMLStreamException
protected void reportInvalidOther(int mask) throws XMLStreamException
reportInvalidOther
in class ByteBasedScanner
XMLStreamException
protected void reportInvalidOther(int mask, int ptr) throws XMLStreamException
XMLStreamException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |