Class NonBlockingParserBase
- java.lang.Object
-
- com.fasterxml.jackson.core.JsonParser
-
- com.fasterxml.jackson.core.base.ParserMinimalBase
-
- com.fasterxml.jackson.dataformat.smile.SmileParserBase
-
- com.fasterxml.jackson.dataformat.smile.async.NonBlockingParserBase
-
- All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
NonBlockingByteArrayParser
public abstract class NonBlockingParserBase extends SmileParserBase
-
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.core.util.ByteArrayBuilder_byteArrayBuilderByteArrayBuilder is needed if 'getBinaryValue' is called.protected boolean_endOfInputFlag that is sent when calling application indicates that there will be no more input to parse.protected byte[]_inputCopyTemporary buffer for holding content if input not contiguous (but can fit in buffer)protected int_inputCopyLenNumber of bytes buffered in_inputCopyprotected int_majorStateCurrent main decoding stateprotected int_majorStateAfterValueValue of_majorStateafter completing a scalar valueprotected int_minorStateAddition indicator within state; contextually relevant for just that stateprotected int_pending32Temporary storage for 32-bit values (int, float), as well as length markers for length-prefixed values.protected long_pending64Temporary storage for 64-bit values (long, double), secondary storage for some other things (scale of BigDecimal values)protected static intMAJOR_ARRAY_ELEMENTprotected static intMAJOR_CLOSEDState after non-blocking input source has indicated that no more input is forthcoming AND we have exhausted all the inputprotected static intMAJOR_INITIALState right after parser has been constructed, before seeing the first byte to know if there's header.protected static intMAJOR_OBJECT_FIELDprotected static intMAJOR_OBJECT_VALUEprotected static intMAJOR_ROOTState right after parser a root value has been finished, but next token has not yet been recognized.protected static intMINOR_FIELD_NAME_2BYTEprotected static intMINOR_FIELD_NAME_LONGprotected static intMINOR_FIELD_NAME_SHORT_ASCIIprotected static intMINOR_FIELD_NAME_SHORT_UNICODEprotected static intMINOR_HEADER_INITIALprotected static intMINOR_HEADER_INLINEprotected static intMINOR_VALUE_BINARY_7BIT_BODYprotected static intMINOR_VALUE_BINARY_7BIT_LENprotected static intMINOR_VALUE_BINARY_RAW_BODYprotected static intMINOR_VALUE_BINARY_RAW_LENprotected static intMINOR_VALUE_NUMBER_BIGDEC_BODYprotected static intMINOR_VALUE_NUMBER_BIGDEC_LENprotected static intMINOR_VALUE_NUMBER_BIGDEC_SCALEprotected static intMINOR_VALUE_NUMBER_BIGINT_BODYprotected static intMINOR_VALUE_NUMBER_BIGINT_LENprotected static intMINOR_VALUE_NUMBER_DOUBLEprotected static intMINOR_VALUE_NUMBER_FLOATprotected static intMINOR_VALUE_NUMBER_INTprotected static intMINOR_VALUE_NUMBER_LONGprotected static intMINOR_VALUE_STRING_LONG_ASCIIprotected static intMINOR_VALUE_STRING_LONG_UNICODEprotected static intMINOR_VALUE_STRING_SHARED_2BYTEprotected static intMINOR_VALUE_STRING_SHORT_ASCIIprotected static intMINOR_VALUE_STRING_SHORT_UNICODE-
Fields inherited from class com.fasterxml.jackson.dataformat.smile.SmileParserBase
_binaryValue, _closed, _currInputProcessed, _formatFeatures, _inputEnd, _inputPtr, _ioContext, _mayContainRawBinary, _nameCopied, _nameCopyBuffer, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberLong, _numberType, _numTypesValid, _quad1, _quad2, _quad3, _quadBuffer, _seenNameCount, _seenNames, _seenStringValueCount, _seenStringValues, _streamReadConstraints, _streamReadContext, _symbols, _symbolsCanonical, _textBuffer, _tokenOffsetForTotal, DEFAULT_NAME_BUFFER_LENGTH, DEFAULT_STRING_VALUE_BUFFER_LENGTH, LONGEST_NON_CHUNKED_BINARY, NO_STRINGS, SMILE_READ_CAPABILITIES
-
Fields inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
_currToken, _lastClearedToken, BD_MAX_INT, BD_MAX_LONG, BD_MIN_INT, BD_MIN_LONG, BI_MAX_INT, BI_MAX_LONG, BI_MIN_INT, BI_MIN_LONG, CHAR_NULL, INT_0, INT_9, INT_APOS, INT_ASTERISK, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_e, INT_E, INT_HASH, INT_LBRACKET, INT_LCURLY, INT_LF, INT_MINUS, INT_PERIOD, INT_PLUS, INT_QUOTE, INT_RBRACKET, INT_RCURLY, INT_SLASH, INT_SPACE, INT_TAB, MAX_ERROR_TOKEN_LENGTH, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MIN_INT_D, MIN_INT_L, MIN_LONG_D, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNonBlockingParserBase(com.fasterxml.jackson.core.io.IOContext ctxt, int parserFeatures, int smileFeatures, com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer sym)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.String_addDecodedToSymbols(int len, java.lang.String name)protected void_addSeenStringValue(java.lang.String v)protected com.fasterxml.jackson.core.JsonToken_closeArrayScope()protected void_closeInput()protected com.fasterxml.jackson.core.JsonToken_closeObjectScope()protected com.fasterxml.jackson.core.JsonToken_eofAsNextToken()Helper method called at point when all input has been exhausted and input feeder has indicated no more input will be forthcoming.protected java.lang.String[]_expandSeenNames(java.lang.String[] oldShared)Method called to try to expand shared name area to fit one more potentially shared String.private void_expandSeenStringValues(java.lang.String v)protected java.lang.String_findDecodedFromSymbols(byte[] inBuf, int inPtr, int len)private java.lang.String_findDecodedLonger(byte[] inBuf, int inPtr, int len)protected com.fasterxml.jackson.core.JsonToken_handleSharedName(int index)protected com.fasterxml.jackson.core.JsonToken_handleSharedString(int index)void_initByteArrayBuilder()protected void_parseNumericValue()protected void_releaseBuffers2()Method called to release internal buffers owned by the base reader.protected void_reportInvalidInitial(int mask)protected void_reportInvalidOther(int mask, int ptr)protected void_reportInvalidSharedName(int index)protected void_reportInvalidSharedStringValue(int index)protected void_reportMissingHeader(int unmaskedFirstByte)protected com.fasterxml.jackson.core.JsonToken_startArrayScope()protected com.fasterxml.jackson.core.JsonToken_startObjectScope()protected com.fasterxml.jackson.core.JsonToken_valueComplete(com.fasterxml.jackson.core.JsonToken t)booleancanParseAsync()byte[]getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant)com.fasterxml.jackson.core.ObjectCodecgetCodec()java.lang.ObjectgetEmbeddedObject()java.lang.ObjectgetInputSource()java.lang.StringgetText()Method for accessing textual representation of the current event; if no current event (before first call toParserMinimalBase.nextToken(), or after encountering end-of-input), returns null.intgetText(java.io.Writer w)char[]getTextCharacters()intgetTextLength()intgetTextOffset()booleanhasTextCharacters()intreadBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant, java.io.OutputStream out)abstract intreleaseBuffered(java.io.OutputStream out)voidsetCodec(com.fasterxml.jackson.core.ObjectCodec c)protected com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizersymbolTableForTests()-
Methods inherited from class com.fasterxml.jackson.dataformat.smile.SmileParserBase
_handleEOF, _releaseBuffers, _reportMismatchedEndMarker, _sourceReference, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, currentLocation, currentName, currentTokenLocation, getBigIntegerValue, getCurrentLocation, getCurrentName, getDecimalValue, getDoubleValue, getFloatValue, getFormatFeatures, getIntValue, getLongValue, getNumberType, getNumberTypeFP, getNumberValue, getNumberValueExact, getParsingContext, getReadCapabilities, getTokenLocation, isClosed, isNaN, mayContainRawBinary, overrideCurrentName, overrideFormatFeatures, streamReadConstraints, version
-
Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
_ascii, _asciiBytes, _constructError, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportMissingRootWS, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _throwInternalReturnAny, _throwInvalidSpace, _wrapError, clearCurrentToken, currentToken, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextToken, nextValue, reportInvalidNumber, reportOverflowInt, reportOverflowInt, reportOverflowInt, reportOverflowLong, reportOverflowLong, reportOverflowLong, reportUnexpectedNumberChar, skipChildren
-
Methods inherited from class com.fasterxml.jackson.core.JsonParser
_codec, _constructError, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, assignCurrentValue, canReadObjectId, canReadTypeId, canUseSchema, configure, currentValue, disable, enable, finishToken, getBinaryValue, getBooleanValue, getByteValue, getCurrentValue, getFeatureMask, getNonBlockingInputFeeder, getNumberValueDeferred, getObjectId, getSchema, getShortValue, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, overrideStdFeatures, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, requiresCustomCodec, setCurrentValue, setFeatureMask, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchema
-
-
-
-
Field Detail
-
MAJOR_INITIAL
protected static final int MAJOR_INITIAL
State right after parser has been constructed, before seeing the first byte to know if there's header.- See Also:
- Constant Field Values
-
MAJOR_ROOT
protected static final int MAJOR_ROOT
State right after parser a root value has been finished, but next token has not yet been recognized.- See Also:
- Constant Field Values
-
MAJOR_OBJECT_FIELD
protected static final int MAJOR_OBJECT_FIELD
- See Also:
- Constant Field Values
-
MAJOR_OBJECT_VALUE
protected static final int MAJOR_OBJECT_VALUE
- See Also:
- Constant Field Values
-
MAJOR_ARRAY_ELEMENT
protected static final int MAJOR_ARRAY_ELEMENT
- See Also:
- Constant Field Values
-
MAJOR_CLOSED
protected static final int MAJOR_CLOSED
State after non-blocking input source has indicated that no more input is forthcoming AND we have exhausted all the input- See Also:
- Constant Field Values
-
MINOR_HEADER_INITIAL
protected static final int MINOR_HEADER_INITIAL
- See Also:
- Constant Field Values
-
MINOR_HEADER_INLINE
protected static final int MINOR_HEADER_INLINE
- See Also:
- Constant Field Values
-
MINOR_FIELD_NAME_2BYTE
protected static final int MINOR_FIELD_NAME_2BYTE
- See Also:
- Constant Field Values
-
MINOR_FIELD_NAME_LONG
protected static final int MINOR_FIELD_NAME_LONG
- See Also:
- Constant Field Values
-
MINOR_FIELD_NAME_SHORT_ASCII
protected static final int MINOR_FIELD_NAME_SHORT_ASCII
- See Also:
- Constant Field Values
-
MINOR_FIELD_NAME_SHORT_UNICODE
protected static final int MINOR_FIELD_NAME_SHORT_UNICODE
- See Also:
- Constant Field Values
-
MINOR_VALUE_NUMBER_INT
protected static final int MINOR_VALUE_NUMBER_INT
- See Also:
- Constant Field Values
-
MINOR_VALUE_NUMBER_LONG
protected static final int MINOR_VALUE_NUMBER_LONG
- See Also:
- Constant Field Values
-
MINOR_VALUE_NUMBER_FLOAT
protected static final int MINOR_VALUE_NUMBER_FLOAT
- See Also:
- Constant Field Values
-
MINOR_VALUE_NUMBER_DOUBLE
protected static final int MINOR_VALUE_NUMBER_DOUBLE
- See Also:
- Constant Field Values
-
MINOR_VALUE_NUMBER_BIGINT_LEN
protected static final int MINOR_VALUE_NUMBER_BIGINT_LEN
- See Also:
- Constant Field Values
-
MINOR_VALUE_NUMBER_BIGINT_BODY
protected static final int MINOR_VALUE_NUMBER_BIGINT_BODY
- See Also:
- Constant Field Values
-
MINOR_VALUE_NUMBER_BIGDEC_SCALE
protected static final int MINOR_VALUE_NUMBER_BIGDEC_SCALE
- See Also:
- Constant Field Values
-
MINOR_VALUE_NUMBER_BIGDEC_LEN
protected static final int MINOR_VALUE_NUMBER_BIGDEC_LEN
- See Also:
- Constant Field Values
-
MINOR_VALUE_NUMBER_BIGDEC_BODY
protected static final int MINOR_VALUE_NUMBER_BIGDEC_BODY
- See Also:
- Constant Field Values
-
MINOR_VALUE_STRING_SHORT_ASCII
protected static final int MINOR_VALUE_STRING_SHORT_ASCII
- See Also:
- Constant Field Values
-
MINOR_VALUE_STRING_SHORT_UNICODE
protected static final int MINOR_VALUE_STRING_SHORT_UNICODE
- See Also:
- Constant Field Values
-
MINOR_VALUE_STRING_LONG_ASCII
protected static final int MINOR_VALUE_STRING_LONG_ASCII
- See Also:
- Constant Field Values
-
MINOR_VALUE_STRING_LONG_UNICODE
protected static final int MINOR_VALUE_STRING_LONG_UNICODE
- See Also:
- Constant Field Values
-
MINOR_VALUE_STRING_SHARED_2BYTE
protected static final int MINOR_VALUE_STRING_SHARED_2BYTE
- See Also:
- Constant Field Values
-
MINOR_VALUE_BINARY_RAW_LEN
protected static final int MINOR_VALUE_BINARY_RAW_LEN
- See Also:
- Constant Field Values
-
MINOR_VALUE_BINARY_RAW_BODY
protected static final int MINOR_VALUE_BINARY_RAW_BODY
- See Also:
- Constant Field Values
-
MINOR_VALUE_BINARY_7BIT_LEN
protected static final int MINOR_VALUE_BINARY_7BIT_LEN
- See Also:
- Constant Field Values
-
MINOR_VALUE_BINARY_7BIT_BODY
protected static final int MINOR_VALUE_BINARY_7BIT_BODY
- See Also:
- Constant Field Values
-
_majorState
protected int _majorState
Current main decoding state
-
_minorState
protected int _minorState
Addition indicator within state; contextually relevant for just that state
-
_majorStateAfterValue
protected int _majorStateAfterValue
Value of_majorStateafter completing a scalar value
-
_endOfInput
protected boolean _endOfInput
Flag that is sent when calling application indicates that there will be no more input to parse.
-
_inputCopy
protected byte[] _inputCopy
Temporary buffer for holding content if input not contiguous (but can fit in buffer)
-
_inputCopyLen
protected int _inputCopyLen
Number of bytes buffered in_inputCopy
-
_pending32
protected int _pending32
Temporary storage for 32-bit values (int, float), as well as length markers for length-prefixed values.
-
_pending64
protected long _pending64
Temporary storage for 64-bit values (long, double), secondary storage for some other things (scale of BigDecimal values)
-
_byteArrayBuilder
protected com.fasterxml.jackson.core.util.ByteArrayBuilder _byteArrayBuilder
ByteArrayBuilder is needed if 'getBinaryValue' is called. If so, we better reuse it for remainder of content.
-
-
Method Detail
-
getCodec
public com.fasterxml.jackson.core.ObjectCodec getCodec()
- Specified by:
getCodecin classcom.fasterxml.jackson.core.JsonParser
-
setCodec
public void setCodec(com.fasterxml.jackson.core.ObjectCodec c)
- Specified by:
setCodecin classcom.fasterxml.jackson.core.JsonParser
-
canParseAsync
public boolean canParseAsync()
- Overrides:
canParseAsyncin classcom.fasterxml.jackson.core.JsonParser- Since:
- 2.9
-
_releaseBuffers2
protected void _releaseBuffers2()
Method called to release internal buffers owned by the base reader. This may be called along with_closeInput()(for example, when explicitly closing this reader instance), or separately (if need be).- Specified by:
_releaseBuffers2in classSmileParserBase
-
symbolTableForTests
protected com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer symbolTableForTests()
-
releaseBuffered
public abstract int releaseBuffered(java.io.OutputStream out) throws java.io.IOException- Overrides:
releaseBufferedin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getInputSource
public java.lang.Object getInputSource()
- Overrides:
getInputSourcein classcom.fasterxml.jackson.core.JsonParser
-
_closeInput
protected void _closeInput() throws java.io.IOException- Specified by:
_closeInputin classSmileParserBase- Throws:
java.io.IOException
-
_parseNumericValue
protected void _parseNumericValue() throws java.io.IOException- Specified by:
_parseNumericValuein classSmileParserBase- Throws:
java.io.IOException
-
hasTextCharacters
public boolean hasTextCharacters()
- Specified by:
hasTextCharactersin classcom.fasterxml.jackson.core.base.ParserMinimalBase
-
getText
public java.lang.String getText() throws java.io.IOExceptionMethod for accessing textual representation of the current event; if no current event (before first call toParserMinimalBase.nextToken(), or after encountering end-of-input), returns null. Method can be called for any event.- Specified by:
getTextin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getTextCharacters
public char[] getTextCharacters() throws java.io.IOException- Specified by:
getTextCharactersin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getTextLength
public int getTextLength() throws java.io.IOException- Specified by:
getTextLengthin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getTextOffset
public int getTextOffset() throws java.io.IOException- Specified by:
getTextOffsetin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getText
public int getText(java.io.Writer w) throws java.io.IOException- Overrides:
getTextin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getBinaryValue
public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant) throws java.io.IOException- Specified by:
getBinaryValuein classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getEmbeddedObject
public java.lang.Object getEmbeddedObject() throws java.io.IOException- Overrides:
getEmbeddedObjectin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
readBinaryValue
public int readBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant, java.io.OutputStream out) throws java.io.IOException- Overrides:
readBinaryValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
_startArrayScope
protected final com.fasterxml.jackson.core.JsonToken _startArrayScope() throws java.io.IOException- Throws:
java.io.IOException
-
_startObjectScope
protected final com.fasterxml.jackson.core.JsonToken _startObjectScope() throws java.io.IOException- Throws:
java.io.IOException
-
_closeArrayScope
protected final com.fasterxml.jackson.core.JsonToken _closeArrayScope() throws java.io.IOException- Throws:
java.io.IOException
-
_closeObjectScope
protected final com.fasterxml.jackson.core.JsonToken _closeObjectScope() throws java.io.IOException- Throws:
java.io.IOException
-
_findDecodedFromSymbols
protected final java.lang.String _findDecodedFromSymbols(byte[] inBuf, int inPtr, int len) throws java.io.IOException- Throws:
java.io.IOException
-
_findDecodedLonger
private final java.lang.String _findDecodedLonger(byte[] inBuf, int inPtr, int len) throws java.io.IOException- Throws:
java.io.IOException
-
_addDecodedToSymbols
protected final java.lang.String _addDecodedToSymbols(int len, java.lang.String name) throws java.io.IOException- Throws:
java.io.IOException
-
_expandSeenNames
protected final java.lang.String[] _expandSeenNames(java.lang.String[] oldShared)
Method called to try to expand shared name area to fit one more potentially shared String. If area is already at its biggest size, will just clear the area (by setting next-offset to 0)
-
_eofAsNextToken
protected final com.fasterxml.jackson.core.JsonToken _eofAsNextToken() throws java.io.IOExceptionHelper method called at point when all input has been exhausted and input feeder has indicated no more input will be forthcoming.- Throws:
java.io.IOException
-
_valueComplete
protected final com.fasterxml.jackson.core.JsonToken _valueComplete(com.fasterxml.jackson.core.JsonToken t) throws java.io.IOException- Throws:
java.io.IOException
-
_handleSharedString
protected final com.fasterxml.jackson.core.JsonToken _handleSharedString(int index) throws java.io.IOException- Throws:
java.io.IOException
-
_handleSharedName
protected final com.fasterxml.jackson.core.JsonToken _handleSharedName(int index) throws java.io.IOException- Throws:
java.io.IOException
-
_addSeenStringValue
protected final void _addSeenStringValue(java.lang.String v) throws java.io.IOException- Throws:
java.io.IOException
-
_expandSeenStringValues
private final void _expandSeenStringValues(java.lang.String v)
-
_initByteArrayBuilder
public void _initByteArrayBuilder()
-
_reportMissingHeader
protected void _reportMissingHeader(int unmaskedFirstByte) throws java.io.IOException- Throws:
java.io.IOException
-
_reportInvalidSharedName
protected void _reportInvalidSharedName(int index) throws java.io.IOException- Throws:
java.io.IOException
-
_reportInvalidSharedStringValue
protected void _reportInvalidSharedStringValue(int index) throws java.io.IOException- Throws:
java.io.IOException
-
_reportInvalidInitial
protected void _reportInvalidInitial(int mask) throws com.fasterxml.jackson.core.JsonParseException- Throws:
com.fasterxml.jackson.core.JsonParseException
-
_reportInvalidOther
protected void _reportInvalidOther(int mask, int ptr) throws com.fasterxml.jackson.core.JsonParseException- Throws:
com.fasterxml.jackson.core.JsonParseException
-
-