Class NonBlockingParserBase
java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
tools.jackson.dataformat.smile.SmileParserBase
tools.jackson.dataformat.smile.async.NonBlockingParserBase
- All Implemented Interfaces:
Closeable, AutoCloseable, tools.jackson.core.Versioned
- Direct Known Subclasses:
NonBlockingByteArrayParser
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.core.JsonParser
tools.jackson.core.JsonParser.NumberType, tools.jackson.core.JsonParser.NumberTypeFP -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected tools.jackson.core.util.ByteArrayBuilderByteArrayBuilder is needed if 'getBinaryValue' is called.protected booleanFlag that is sent when calling application indicates that there will be no more input to parse.protected byte[]Temporary buffer for holding content if input not contiguous (but can fit in buffer)protected intNumber of bytes buffered in_inputCopyprotected intCurrent main decoding stateprotected intValue of_majorStateafter completing a scalar valueprotected intAddition indicator within state; contextually relevant for just that stateprotected intTemporary storage for 32-bit values (int, float), as well as length markers for length-prefixed values.protected longTemporary storage for 64-bit values (long, double), secondary storage for some other things (scale of BigDecimal values)protected static final intprotected static final intState after non-blocking input source has indicated that no more input is forthcoming AND we have exhausted all the inputprotected static final intState right after parser has been constructed, before seeing the first byte to know if there's header.protected static final intprotected static final intprotected static final intState right after parser a root value has been finished, but next token has not yet been recognized.protected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intFields inherited from class SmileParserBase
_binaryValue, _currInputProcessed, _formatFeatures, _inputEnd, _inputPtr, _mayContainRawBinary, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberLong, _numberType, _numTypesValid, _quad1, _quad2, _quad3, _quadBuffer, _seenNameCount, _seenNames, _seenStringValueCount, _seenStringValues, _streamReadContext, _symbols, _symbolsCanonical, _textBuffer, _tokenOffsetForTotal, DEFAULT_NAME_BUFFER_LENGTH, DEFAULT_STRING_VALUE_BUFFER_LENGTH, LONGEST_NON_CHUNKED_BINARY, NO_STRINGS, SMILE_READ_CAPABILITIESFields inherited from class tools.jackson.core.base.ParserMinimalBase
_closed, _currToken, _ioContext, _lastClearedToken, _objectReadContext, _streamReadConstraints, _streamReadFeatures, _tokenCount, _trackMaxTokenCount, 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_RS, INT_SLASH, INT_SPACE, INT_TAB, MAX_BYTE_I, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MAX_SHORT_I, MIN_BYTE_I, MIN_INT_D, MIN_INT_L, MIN_LONG_D, MIN_SHORT_I, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN, STREAM_READ_FEATURE_DEFAULTSFields inherited from class tools.jackson.core.JsonParser
DEFAULT_READ_CAPABILITIES -
Constructor Summary
ConstructorsConstructorDescriptionNonBlockingParserBase(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int smileFeatures, tools.jackson.core.sym.ByteQuadsCanonicalizer sym) -
Method Summary
Modifier and TypeMethodDescriptionprotected final String_addDecodedToSymbols(int len, String name) protected final voidprotected final tools.jackson.core.JsonTokenprotected voidprotected final tools.jackson.core.JsonTokenprotected final tools.jackson.core.JsonTokenHelper method called at point when all input has been exhausted and input feeder has indicated no more input will be forthcoming.protected final String[]_expandSeenNames(String[] oldShared) Method called to try to expand shared name area to fit one more potentially shared String.private final voidprotected final String_findDecodedFromSymbols(byte[] inBuf, int inPtr, int len) private final String_findDecodedLonger(byte[] inBuf, int inPtr, int len) protected final tools.jackson.core.JsonToken_handleSharedName(int index) protected final tools.jackson.core.JsonToken_handleSharedString(int index) voidprotected voidMethod called to complete parsing of a numeric value: will throwStreamReadExceptionif current token is not numeric.protected booleanSimilar toSmileParserBase._parseNumericValue(), but will not throw exception if the current token is not a numeric value.protected voidMethod 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 final tools.jackson.core.JsonTokenprotected final tools.jackson.core.JsonTokenprotected final tools.jackson.core.JsonToken_valueComplete(tools.jackson.core.JsonToken t) booleanbyte[]getBinaryValue(tools.jackson.core.Base64Variant b64variant) Method for accessing textual representation of the current event; if no current event (before first call toJsonParser.nextToken(), or after encountering end-of-input), returns null.intchar[]intintbooleanintreadBinaryValue(tools.jackson.core.Base64Variant b64variant, OutputStream out) abstract intprotected tools.jackson.core.sym.ByteQuadsCanonicalizerMethods inherited from class SmileParserBase
_handleEOF, _releaseBuffers, _reportMismatchedEndMarker, _sourceReference, assignCurrentValue, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, currentLocation, currentName, currentTokenLocation, currentValue, getBigIntegerValue, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberTypeFP, getNumberValue, getNumberValueExact, isClosed, isNaN, mayContainRawBinary, streamReadCapabilities, streamReadContext, versionMethods inherited from class tools.jackson.core.base.ParserMinimalBase
_constructInputCoercion, _constructNotNumericType, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportBadInputStream, _reportBadReader, _reportError, _reportError, _reportError, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidNumber, _reportInvalidSpace, _reportInvalidUTF8Surrogate, _reportMissingRootWS, _reportOverflowByte, _reportOverflowInt, _reportOverflowInt, _reportOverflowInt, _reportOverflowLong, _reportOverflowLong, _reportOverflowLong, _reportOverflowShort, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapIOFailure, clearCurrentToken, currentNameMatch, currentToken, currentTokenCount, currentTokenId, finishToken, getBooleanValue, getByteValue, getLastClearedToken, getNumberValueDeferred, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextName, nextName, nextNameMatch, nextValue, objectReadContext, readValueAs, readValueAs, readValueAs, readValueAsTree, skipChildren, streamReadConstraints, streamReadFeaturesMethods inherited from class tools.jackson.core.JsonParser
_constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, canReadObjectId, canReadTypeId, getBinaryValue, getObjectId, getSchema, getText, getTextCharacters, getTextLength, getTextOffset, getTypeId, getValueAsBoolean, getValueAsDouble, nextBooleanValue, nextIntValue, nextLongValue, nextStringValue, nextToken, nonBlockingInputFeeder, readBinaryValue, readString, releaseBuffered
-
Field Details
-
MAJOR_INITIAL
protected static final int MAJOR_INITIALState right after parser has been constructed, before seeing the first byte to know if there's header.- See Also:
-
MAJOR_ROOT
protected static final int MAJOR_ROOTState right after parser a root value has been finished, but next token has not yet been recognized.- See Also:
-
MAJOR_OBJECT_FIELD
protected static final int MAJOR_OBJECT_FIELD- See Also:
-
MAJOR_OBJECT_VALUE
protected static final int MAJOR_OBJECT_VALUE- See Also:
-
MAJOR_ARRAY_ELEMENT
protected static final int MAJOR_ARRAY_ELEMENT- See Also:
-
MAJOR_CLOSED
protected static final int MAJOR_CLOSEDState after non-blocking input source has indicated that no more input is forthcoming AND we have exhausted all the input- See Also:
-
MINOR_HEADER_INITIAL
protected static final int MINOR_HEADER_INITIAL- See Also:
-
MINOR_HEADER_INLINE
protected static final int MINOR_HEADER_INLINE- See Also:
-
MINOR_PROPERTY_NAME_2BYTE
protected static final int MINOR_PROPERTY_NAME_2BYTE- See Also:
-
MINOR_PROPERTY_NAME_LONG
protected static final int MINOR_PROPERTY_NAME_LONG- See Also:
-
MINOR_PROPERTY_NAME_SHORT_ASCII
protected static final int MINOR_PROPERTY_NAME_SHORT_ASCII- See Also:
-
MINOR_PROPERTY_NAME_SHORT_UNICODE
protected static final int MINOR_PROPERTY_NAME_SHORT_UNICODE- See Also:
-
MINOR_VALUE_NUMBER_INT
protected static final int MINOR_VALUE_NUMBER_INT- See Also:
-
MINOR_VALUE_NUMBER_LONG
protected static final int MINOR_VALUE_NUMBER_LONG- See Also:
-
MINOR_VALUE_NUMBER_FLOAT
protected static final int MINOR_VALUE_NUMBER_FLOAT- See Also:
-
MINOR_VALUE_NUMBER_DOUBLE
protected static final int MINOR_VALUE_NUMBER_DOUBLE- See Also:
-
MINOR_VALUE_NUMBER_BIGINT_LEN
protected static final int MINOR_VALUE_NUMBER_BIGINT_LEN- See Also:
-
MINOR_VALUE_NUMBER_BIGINT_BODY
protected static final int MINOR_VALUE_NUMBER_BIGINT_BODY- See Also:
-
MINOR_VALUE_NUMBER_BIGDEC_SCALE
protected static final int MINOR_VALUE_NUMBER_BIGDEC_SCALE- See Also:
-
MINOR_VALUE_NUMBER_BIGDEC_LEN
protected static final int MINOR_VALUE_NUMBER_BIGDEC_LEN- See Also:
-
MINOR_VALUE_NUMBER_BIGDEC_BODY
protected static final int MINOR_VALUE_NUMBER_BIGDEC_BODY- See Also:
-
MINOR_VALUE_STRING_SHORT_ASCII
protected static final int MINOR_VALUE_STRING_SHORT_ASCII- See Also:
-
MINOR_VALUE_STRING_SHORT_UNICODE
protected static final int MINOR_VALUE_STRING_SHORT_UNICODE- See Also:
-
MINOR_VALUE_STRING_LONG_ASCII
protected static final int MINOR_VALUE_STRING_LONG_ASCII- See Also:
-
MINOR_VALUE_STRING_LONG_UNICODE
protected static final int MINOR_VALUE_STRING_LONG_UNICODE- See Also:
-
MINOR_VALUE_STRING_SHARED_2BYTE
protected static final int MINOR_VALUE_STRING_SHARED_2BYTE- See Also:
-
MINOR_VALUE_BINARY_RAW_LEN
protected static final int MINOR_VALUE_BINARY_RAW_LEN- See Also:
-
MINOR_VALUE_BINARY_RAW_BODY
protected static final int MINOR_VALUE_BINARY_RAW_BODY- See Also:
-
MINOR_VALUE_BINARY_7BIT_LEN
protected static final int MINOR_VALUE_BINARY_7BIT_LEN- See Also:
-
MINOR_VALUE_BINARY_7BIT_BODY
protected static final int MINOR_VALUE_BINARY_7BIT_BODY- See Also:
-
_majorState
protected int _majorStateCurrent main decoding state -
_minorState
protected int _minorStateAddition indicator within state; contextually relevant for just that state -
_majorStateAfterValue
protected int _majorStateAfterValueValue of_majorStateafter completing a scalar value -
_endOfInput
protected boolean _endOfInputFlag that is sent when calling application indicates that there will be no more input to parse. -
_inputCopy
protected byte[] _inputCopyTemporary buffer for holding content if input not contiguous (but can fit in buffer) -
_inputCopyLen
protected int _inputCopyLenNumber of bytes buffered in_inputCopy -
_pending32
protected int _pending32Temporary storage for 32-bit values (int, float), as well as length markers for length-prefixed values. -
_pending64
protected long _pending64Temporary storage for 64-bit values (long, double), secondary storage for some other things (scale of BigDecimal values) -
_byteArrayBuilder
protected tools.jackson.core.util.ByteArrayBuilder _byteArrayBuilderByteArrayBuilder is needed if 'getBinaryValue' is called. If so, we better reuse it for remainder of content.
-
-
Constructor Details
-
NonBlockingParserBase
public NonBlockingParserBase(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int smileFeatures, tools.jackson.core.sym.ByteQuadsCanonicalizer sym)
-
-
Method Details
-
canParseAsync
public boolean canParseAsync()- Overrides:
canParseAsyncin classtools.jackson.core.JsonParser
-
_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 tools.jackson.core.sym.ByteQuadsCanonicalizer symbolTableForTests() -
releaseBuffered
- Overrides:
releaseBufferedin classtools.jackson.core.JsonParser
-
streamReadInputSource
- Specified by:
streamReadInputSourcein classtools.jackson.core.JsonParser
-
_closeInput
protected void _closeInput()- Specified by:
_closeInputin classSmileParserBase
-
_parseNumericValue
protected void _parseNumericValue() throws tools.jackson.core.JacksonExceptionDescription copied from class:SmileParserBaseMethod called to complete parsing of a numeric value: will throwStreamReadExceptionif current token is not numeric.- Specified by:
_parseNumericValuein classSmileParserBase- Throws:
tools.jackson.core.JacksonException
-
_parseNumericValueIfNumber
protected boolean _parseNumericValueIfNumber() throws tools.jackson.core.JacksonExceptionDescription copied from class:SmileParserBaseSimilar toSmileParserBase._parseNumericValue(), but will not throw exception if the current token is not a numeric value.- Specified by:
_parseNumericValueIfNumberin classSmileParserBase- Returns:
trueif current token is numeric;falseotherwise- Throws:
tools.jackson.core.JacksonException
-
hasStringCharacters
public boolean hasStringCharacters()- Specified by:
hasStringCharactersin classtools.jackson.core.JsonParser
-
getString
Method for accessing textual representation of the current event; if no current event (before first call toJsonParser.nextToken(), or after encountering end-of-input), returns null. Method can be called for any event.- Specified by:
getStringin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getStringCharacters
public char[] getStringCharacters() throws tools.jackson.core.JacksonException- Specified by:
getStringCharactersin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getStringLength
public int getStringLength() throws tools.jackson.core.JacksonException- Specified by:
getStringLengthin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getStringOffset
public int getStringOffset() throws tools.jackson.core.JacksonException- Specified by:
getStringOffsetin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getString
- Overrides:
getStringin classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
getBinaryValue
public byte[] getBinaryValue(tools.jackson.core.Base64Variant b64variant) throws tools.jackson.core.JacksonException - Specified by:
getBinaryValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getEmbeddedObject
- Overrides:
getEmbeddedObjectin classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
readBinaryValue
public int readBinaryValue(tools.jackson.core.Base64Variant b64variant, OutputStream out) throws tools.jackson.core.JacksonException - Overrides:
readBinaryValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
_startArrayScope
protected final tools.jackson.core.JsonToken _startArrayScope() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_startObjectScope
protected final tools.jackson.core.JsonToken _startObjectScope() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_closeArrayScope
protected final tools.jackson.core.JsonToken _closeArrayScope() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_closeObjectScope
protected final tools.jackson.core.JsonToken _closeObjectScope() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_findDecodedFromSymbols
protected final String _findDecodedFromSymbols(byte[] inBuf, int inPtr, int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_findDecodedLonger
private final String _findDecodedLonger(byte[] inBuf, int inPtr, int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_addDecodedToSymbols
-
_expandSeenNames
-
_eofAsNextToken
protected final tools.jackson.core.JsonToken _eofAsNextToken() throws tools.jackson.core.JacksonExceptionHelper method called at point when all input has been exhausted and input feeder has indicated no more input will be forthcoming.- Throws:
tools.jackson.core.JacksonException
-
_valueComplete
protected final tools.jackson.core.JsonToken _valueComplete(tools.jackson.core.JsonToken t) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_addSeenStringValue
- Throws:
tools.jackson.core.JacksonException
-
_expandSeenStringValues
-
_initByteArrayBuilder
public void _initByteArrayBuilder() -
_reportMissingHeader
protected void _reportMissingHeader(int unmaskedFirstByte) throws tools.jackson.core.exc.StreamReadException - Throws:
tools.jackson.core.exc.StreamReadException
-
_reportInvalidInitial
protected void _reportInvalidInitial(int mask) throws tools.jackson.core.exc.StreamReadException - Throws:
tools.jackson.core.exc.StreamReadException
-
_reportInvalidOther
protected void _reportInvalidOther(int mask, int ptr) throws tools.jackson.core.exc.StreamReadException - Throws:
tools.jackson.core.exc.StreamReadException
-