|
|||||||||
| 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 |
|---|
_inputBuffer, _inputEnd, _inputPtr |
| Fields inherited from class com.fasterxml.aalto.in.ByteBasedScanner |
|---|
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, mCharTypes, mPastBytes, mQuadBuffer, mRowStartOffset, mSymbols, mTmpChar |
| 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 | |
|---|---|
Utf8Scanner(ReaderConfig cfg,
java.io.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 java.lang.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 java.lang.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 |
skipDTD()
Eventually, we should properly parse the internal subset for rough well-formedness checks. |
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,
java.io.InputStream in,
byte[] buffer,
int ptr,
int last)
| Method Detail |
|---|
protected int handleStartElement(byte b)
throws javax.xml.stream.XMLStreamException
StreamScanner
handleStartElement in class StreamScannerjavax.xml.stream.XMLStreamException
protected final int handleEntityInText(boolean inAttr)
throws javax.xml.stream.XMLStreamException
handleEntityInText in class StreamScannerinAttr - True, if reference is from attribute value; false
if from normal text content
javax.xml.stream.XMLStreamException
protected final PName addPName(int hash,
int[] quads,
int qlen,
int lastQuadBytes)
throws javax.xml.stream.XMLStreamException
addPName in class ByteBasedScannerjavax.xml.stream.XMLStreamException
protected java.lang.String parsePublicId(byte quoteChar)
throws javax.xml.stream.XMLStreamException
parsePublicId in class StreamScannerjavax.xml.stream.XMLStreamException
protected java.lang.String parseSystemId(byte quoteChar)
throws javax.xml.stream.XMLStreamException
parseSystemId in class StreamScannerjavax.xml.stream.XMLStreamException
protected final boolean skipCharacters()
throws javax.xml.stream.XMLStreamException
skipCharacters 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 skipCData()
throws javax.xml.stream.XMLStreamException
skipCData in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void skipDTD()
throws javax.xml.stream.XMLStreamException
Our first take is as simple (simplistic) as possible: we'll just hunt for the closing ']' '>' combination
javax.xml.stream.XMLStreamException
protected final void skipPI()
throws javax.xml.stream.XMLStreamException
skipPI in class XmlScannerjavax.xml.stream.XMLStreamException
protected final void skipSpace()
throws javax.xml.stream.XMLStreamException
skipSpace 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 finishComment()
throws javax.xml.stream.XMLStreamException
finishComment 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 finishPI()
throws javax.xml.stream.XMLStreamException
finishPI 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 finishCoalescedCharacters()
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected final void finishCoalescedCData()
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
public int decodeCharForError(byte b)
throws javax.xml.stream.XMLStreamException
decodeCharForError in class ByteBasedScannerjavax.xml.stream.XMLStreamException
protected void reportInvalidInitial(int mask)
throws javax.xml.stream.XMLStreamException
reportInvalidInitial in class ByteBasedScannerjavax.xml.stream.XMLStreamException
protected void reportInvalidOther(int mask)
throws javax.xml.stream.XMLStreamException
reportInvalidOther in class ByteBasedScannerjavax.xml.stream.XMLStreamException
protected void reportInvalidOther(int mask,
int ptr)
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 | |||||||||