Package com.fasterxml.aalto.in
Class ByteBasedScanner
- java.lang.Object
-
- com.fasterxml.aalto.in.XmlScanner
-
- com.fasterxml.aalto.in.ByteBasedScanner
-
- All Implemented Interfaces:
XmlConsts,javax.xml.namespace.NamespaceContext,javax.xml.stream.XMLStreamConstants
- Direct Known Subclasses:
AsyncByteScanner,StreamScanner
public abstract class ByteBasedScanner extends XmlScanner
Intermediate base class used by different byte-backed scanners. Specifically, used as a base by both blocking (stream) and non-blocking (async) byte-based scanners (as opposed to Reader-backed, character-based scanners)
-
-
Field Summary
Fields Modifier and Type Field Description protected int_inputEndPointer to the first byte after the end of valid content.protected int_inputPtrPointer to the next unread byte in the input buffer.protected int_tmpCharStorage location for a single character that can not be easily pushed back (for example, multi-byte char; or char entity expansion).protected static byteBYTE_aprotected static byteBYTE_Aprotected static byteBYTE_AMPprotected static byteBYTE_APOSprotected static byteBYTE_Cprotected static byteBYTE_CRprotected static byteBYTE_Dprotected static byteBYTE_EQprotected static byteBYTE_EXCLprotected static byteBYTE_gprotected static byteBYTE_GTprotected static byteBYTE_HASHprotected static byteBYTE_HYPHENprotected static byteBYTE_lprotected static byteBYTE_LBRACKETprotected static byteBYTE_LFprotected static byteBYTE_LTprotected static byteBYTE_mprotected static byteBYTE_NULLprotected static byteBYTE_oprotected static byteBYTE_pprotected static byteBYTE_Pprotected static byteBYTE_qprotected static byteBYTE_QMARKprotected static byteBYTE_QUOTprotected static byteBYTE_RBRACKETprotected static byteBYTE_sprotected static byteBYTE_Sprotected static byteBYTE_SEMICOLONprotected static byteBYTE_SLASHprotected static byteBYTE_SPACEprotected static byteBYTE_tprotected static byteBYTE_Tprotected static byteBYTE_TABprotected static byteBYTE_uprotected static byteBYTE_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, _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_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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedByteBasedScanner(ReaderConfig cfg)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void_closeSource()protected PNameaddUTFPName(ByteBasedPNameTable symbols, XmlCharTypes charTypes, int hash, int[] quads, int qlen, int lastQuadBytes)Conceptually, this method really does NOT belong here.protected abstract intdecodeCharForError(byte b)Method called by methods when encountering a byte that can not be part of a valid character in the current context.intgetCurrentColumnNr()org.codehaus.stax2.XMLStreamLocation2getCurrentLocation()longgetEndingByteOffset()longgetEndingCharOffset()longgetStartingByteOffset()longgetStartingCharOffset()protected voidmarkLF()protected voidmarkLF(int offset)protected voidreportInvalidInitial(int mask)protected voidreportInvalidOther(int mask)protected voidsetStartLocation()-
Methods inherited from class com.fasterxml.aalto.in.XmlScanner
_releaseBuffers, bindName, bindNs, checkImmutableBinding, close, decodeAttrBinaryValue, decodeAttrValue, decodeAttrValues, decodeElements, findAttrIndex, findOrCreateBinding, finishCData, finishCharacters, finishComment, finishDTD, finishPI, finishSpace, finishToken, 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, loadMore, loadMoreGuaranteed, loadMoreGuaranteed, nextFromProlog, nextFromTree, reportDoubleHyphenInComments, reportDuplicateNsDecl, reportEntityOverflow, reportEofInName, reportIllegalCDataEnd, reportIllegalNsDecl, reportIllegalNsDecl, reportInputProblem, reportInvalidNameChar, reportInvalidNsIndex, reportInvalidXmlChar, reportMissingPISpace, reportMultipleColonsInName, reportPrologProblem, reportPrologUnexpChar, reportPrologUnexpElement, reportTreeUnexpChar, reportUnboundPrefix, reportUnexpandedEntityInAttr, reportUnexpectedEndTag, resetForDecoding, skipCData, skipCharacters, skipCoalescedText, skipComment, skipPI, skipSpace, skipToken, throwInvalidSpace, throwNullChar, throwUnexpectedChar, verifyXmlChar
-
-
-
-
Field Detail
-
BYTE_NULL
protected static final byte BYTE_NULL
- See Also:
- Constant Field Values
-
BYTE_SPACE
protected static final byte BYTE_SPACE
- See Also:
- Constant Field Values
-
BYTE_LF
protected static final byte BYTE_LF
- See Also:
- Constant Field Values
-
BYTE_CR
protected static final byte BYTE_CR
- See Also:
- Constant Field Values
-
BYTE_TAB
protected static final byte BYTE_TAB
- See Also:
- Constant Field Values
-
BYTE_LT
protected static final byte BYTE_LT
- See Also:
- Constant Field Values
-
BYTE_GT
protected static final byte BYTE_GT
- See Also:
- Constant Field Values
-
BYTE_AMP
protected static final byte BYTE_AMP
- See Also:
- Constant Field Values
-
BYTE_HASH
protected static final byte BYTE_HASH
- See Also:
- Constant Field Values
-
BYTE_EXCL
protected static final byte BYTE_EXCL
- See Also:
- Constant Field Values
-
BYTE_HYPHEN
protected static final byte BYTE_HYPHEN
- See Also:
- Constant Field Values
-
BYTE_QMARK
protected static final byte BYTE_QMARK
- See Also:
- Constant Field Values
-
BYTE_SLASH
protected static final byte BYTE_SLASH
- See Also:
- Constant Field Values
-
BYTE_EQ
protected static final byte BYTE_EQ
- See Also:
- Constant Field Values
-
BYTE_QUOT
protected static final byte BYTE_QUOT
- See Also:
- Constant Field Values
-
BYTE_APOS
protected static final byte BYTE_APOS
- See Also:
- Constant Field Values
-
BYTE_LBRACKET
protected static final byte BYTE_LBRACKET
- See Also:
- Constant Field Values
-
BYTE_RBRACKET
protected static final byte BYTE_RBRACKET
- See Also:
- Constant Field Values
-
BYTE_SEMICOLON
protected static final byte BYTE_SEMICOLON
- See Also:
- Constant Field Values
-
BYTE_a
protected static final byte BYTE_a
- See Also:
- Constant Field Values
-
BYTE_g
protected static final byte BYTE_g
- See Also:
- Constant Field Values
-
BYTE_l
protected static final byte BYTE_l
- See Also:
- Constant Field Values
-
BYTE_m
protected static final byte BYTE_m
- See Also:
- Constant Field Values
-
BYTE_o
protected static final byte BYTE_o
- See Also:
- Constant Field Values
-
BYTE_p
protected static final byte BYTE_p
- See Also:
- Constant Field Values
-
BYTE_q
protected static final byte BYTE_q
- See Also:
- Constant Field Values
-
BYTE_s
protected static final byte BYTE_s
- See Also:
- Constant Field Values
-
BYTE_t
protected static final byte BYTE_t
- See Also:
- Constant Field Values
-
BYTE_u
protected static final byte BYTE_u
- See Also:
- Constant Field Values
-
BYTE_x
protected static final byte BYTE_x
- See Also:
- Constant Field Values
-
BYTE_A
protected static final byte BYTE_A
- See Also:
- Constant Field Values
-
BYTE_C
protected static final byte BYTE_C
- See Also:
- Constant Field Values
-
BYTE_D
protected static final byte BYTE_D
- See Also:
- Constant Field Values
-
BYTE_P
protected static final byte BYTE_P
- See Also:
- Constant Field Values
-
BYTE_S
protected static final byte BYTE_S
- See Also:
- Constant Field Values
-
BYTE_T
protected static final byte BYTE_T
- See Also:
- Constant Field Values
-
_inputPtr
protected int _inputPtr
Pointer to the next unread byte in the input buffer.
-
_inputEnd
protected int _inputEnd
Pointer to the first byte after the end of valid content. This may point beyond of the physical buffer array.
-
_tmpChar
protected int _tmpChar
Storage location for a single character that can not be easily pushed back (for example, multi-byte char; or char entity expansion). Negative, if from entity expansion; positive if a singular char.
-
-
Constructor Detail
-
ByteBasedScanner
protected ByteBasedScanner(ReaderConfig cfg)
-
-
Method Detail
-
_closeSource
protected abstract void _closeSource() throws java.io.IOException- Specified by:
_closeSourcein classXmlScanner- Throws:
java.io.IOException
-
getCurrentLocation
public org.codehaus.stax2.XMLStreamLocation2 getCurrentLocation()
- Specified by:
getCurrentLocationin classXmlScanner- Returns:
- Current input location
-
getCurrentColumnNr
public int getCurrentColumnNr()
- Specified by:
getCurrentColumnNrin classXmlScanner
-
getStartingByteOffset
public long getStartingByteOffset()
- Specified by:
getStartingByteOffsetin classXmlScanner
-
getStartingCharOffset
public long getStartingCharOffset()
- Specified by:
getStartingCharOffsetin classXmlScanner
-
getEndingByteOffset
public long getEndingByteOffset() throws javax.xml.stream.XMLStreamException- Specified by:
getEndingByteOffsetin classXmlScanner- Throws:
javax.xml.stream.XMLStreamException
-
getEndingCharOffset
public long getEndingCharOffset() throws javax.xml.stream.XMLStreamException- Specified by:
getEndingCharOffsetin classXmlScanner- Throws:
javax.xml.stream.XMLStreamException
-
markLF
protected final void markLF(int offset)
-
markLF
protected final void markLF()
-
setStartLocation
protected final void setStartLocation()
-
decodeCharForError
protected abstract int decodeCharForError(byte b) throws javax.xml.stream.XMLStreamExceptionMethod called by methods when encountering a byte that can not be part of a valid character in the current context. Should return the actual decoded character for error reporting purposes.- Throws:
javax.xml.stream.XMLStreamException
-
addUTFPName
protected final PName addUTFPName(ByteBasedPNameTable symbols, XmlCharTypes charTypes, int hash, int[] quads, int qlen, int lastQuadBytes) throws javax.xml.stream.XMLStreamException
Conceptually, this method really does NOT belong here. However, currently it is quite hard to refactor it, so it'll have to stay here until better place is found- Throws:
javax.xml.stream.XMLStreamException
-
reportInvalidInitial
protected void reportInvalidInitial(int mask) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
reportInvalidOther
protected void reportInvalidOther(int mask) throws javax.xml.stream.XMLStreamException- Throws:
javax.xml.stream.XMLStreamException
-
-