|
||||||||||
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.in.StreamScanner
com.fasterxml.aalto.in.Utf8Scanner
public final class Utf8Scanner
Scanner for tokenizing xml content from a byte stream encoding using UTF-8 encoding, or something suitably close it for decoding purposes (including ISO-Latin1 and US-ASCII).
Field Summary |
---|
Fields inherited from class com.fasterxml.aalto.in.StreamScanner |
---|
_in, _inputBuffer, _inputEnd, _inputPtr |
Fields inherited from class com.fasterxml.aalto.in.ByteBasedScanner |
---|
_charTypes, _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 | |
---|---|
Utf8Scanner(ReaderConfig cfg,
InputStream in,
byte[] buffer,
int ptr,
int last)
|
Method Summary | |
---|---|
protected PName |
addPName(int hash,
int[] quads,
int qlen,
int lastQuadBytes)
|
int |
decodeCharForError(byte b)
Method called called to decode a full UTF-8 characters, given its first byte. |
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)
When this method gets called we know that we have an internal subset, and that the opening '[' has already been read. |
protected void |
finishPI()
|
protected void |
finishSpace()
Note: this method is only called in cases where it is known that only space chars are legal. |
protected int |
handleEntityInText(boolean inAttr)
Method called when an ampersand is encounter in text segment. |
protected int |
handleStartElement(byte b)
Parsing of start element requires parsing of the element name (and attribute names), and is thus encoding-specific. |
protected String |
parsePublicId(byte quoteChar)
Parsing of public ids is bit more complicated than that of system ids, since white space is to be coalesced. |
protected String |
parseSystemId(byte quoteChar)
|
protected void |
reportInvalidInitial(int mask)
|
protected void |
reportInvalidOther(int mask)
|
protected void |
reportInvalidOther(int mask,
int ptr)
|
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 void |
skipPI()
|
protected void |
skipSpace()
|
Methods inherited from class com.fasterxml.aalto.in.StreamScanner |
---|
_closeSource, _releaseBuffers, checkInTreeIndentation, checkPrologIndentation, handleCharEntity, handleEndElement, loadAndRetain, loadMore, loadOne, loadOne, nextByte, nextByte, nextFromProlog, nextFromTree, parsePName, parsePNameLong, parsePNameMedium, parsePNameSlow, skipInternalWs |
Methods inherited from class com.fasterxml.aalto.in.ByteBasedScanner |
---|
addUtfPName, getCurrentColumnNr, getCurrentLineNr, getCurrentLocation, markLF, markLF |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utf8Scanner(ReaderConfig cfg, InputStream in, byte[] buffer, int ptr, int last)
Method Detail |
---|
protected int handleStartElement(byte b) throws XMLStreamException
StreamScanner
handleStartElement
in class StreamScanner
XMLStreamException
protected final int handleEntityInText(boolean inAttr) throws XMLStreamException
handleEntityInText
in class StreamScanner
inAttr
- True, if reference is from attribute value; false
if from normal text content
XMLStreamException
protected final PName addPName(int hash, int[] quads, int qlen, int lastQuadBytes) throws XMLStreamException
addPName
in class ByteBasedScanner
XMLStreamException
protected String parsePublicId(byte quoteChar) throws XMLStreamException
parsePublicId
in class StreamScanner
XMLStreamException
protected String parseSystemId(byte quoteChar) throws XMLStreamException
parseSystemId
in class StreamScanner
XMLStreamException
protected final boolean skipCharacters() throws XMLStreamException
skipCharacters
in class XmlScanner
XMLStreamException
protected final void skipComment() throws XMLStreamException
skipComment
in class XmlScanner
XMLStreamException
protected final void skipCData() throws XMLStreamException
skipCData
in class XmlScanner
XMLStreamException
protected final void skipPI() throws XMLStreamException
skipPI
in class XmlScanner
XMLStreamException
protected final void skipSpace() throws XMLStreamException
skipSpace
in class XmlScanner
XMLStreamException
protected final void finishCData() throws XMLStreamException
finishCData
in class XmlScanner
XMLStreamException
protected final void finishCharacters() throws XMLStreamException
finishCharacters
in class XmlScanner
XMLStreamException
protected final void finishComment() throws XMLStreamException
finishComment
in class XmlScanner
XMLStreamException
protected final void finishDTD(boolean copyContents) throws XMLStreamException
finishDTD
in class XmlScanner
XMLStreamException
protected final void finishPI() throws XMLStreamException
finishPI
in class XmlScanner
XMLStreamException
protected final void finishSpace() throws XMLStreamException
finishSpace
in class XmlScanner
XMLStreamException
protected final void finishCoalescedText() throws XMLStreamException
XMLStreamException
protected final void finishCoalescedCharacters() throws XMLStreamException
XMLStreamException
protected final void finishCoalescedCData() throws XMLStreamException
XMLStreamException
protected final boolean skipCoalescedText() throws XMLStreamException
skipCoalescedText
in class XmlScanner
XMLStreamException
public int decodeCharForError(byte b) throws XMLStreamException
decodeCharForError
in class ByteBasedScanner
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 |