Class NonBlockingUtf8JsonParserBase
- java.lang.Object
-
- com.fasterxml.jackson.core.JsonParser
-
- com.fasterxml.jackson.core.base.ParserMinimalBase
-
- com.fasterxml.jackson.core.base.ParserBase
-
- com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase
-
- com.fasterxml.jackson.core.json.async.NonBlockingUtf8JsonParserBase
-
- All Implemented Interfaces:
Versioned,Closeable,AutoCloseable
- Direct Known Subclasses:
NonBlockingByteBufferJsonParser,NonBlockingJsonParser
public abstract class NonBlockingUtf8JsonParserBase extends NonBlockingJsonParserBase
Non-blocking parser base implementation for JSON content.NOTE: only supports parsing of UTF-8 encoded content (and 7-bit US-ASCII since it is strict subset of UTF-8): other encodings are not supported.
- Since:
- 2.9
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonParser
JsonParser.Feature, JsonParser.NumberType
-
-
Field Summary
Fields Modifier and Type Field Description protected static int[]_icLatin1protected int_origBufferLenIn addition to current buffer pointer, and end pointer, we will also need to know number of bytes originally contained.-
Fields inherited from class com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase
_currBufferStart, _currInputRowAlt, _endOfInput, _majorState, _majorStateAfterValue, _minorState, _minorStateAfterSplit, _nonStdTokenType, _pending32, _pendingBytes, _quad1, _quadBuffer, _quadLength, _quoted32, _quotedDigits, _symbols, MAJOR_ARRAY_ELEMENT_FIRST, MAJOR_ARRAY_ELEMENT_NEXT, MAJOR_CLOSED, MAJOR_INITIAL, MAJOR_OBJECT_FIELD_FIRST, MAJOR_OBJECT_FIELD_NEXT, MAJOR_OBJECT_VALUE, MAJOR_ROOT, MINOR_COMMENT_C, MINOR_COMMENT_CLOSING_ASTERISK, MINOR_COMMENT_CPP, MINOR_COMMENT_LEADING_SLASH, MINOR_COMMENT_YAML, MINOR_FIELD_APOS_NAME, MINOR_FIELD_LEADING_COMMA, MINOR_FIELD_LEADING_WS, MINOR_FIELD_NAME, MINOR_FIELD_NAME_ESCAPE, MINOR_FIELD_UNQUOTED_NAME, MINOR_NUMBER_EXPONENT_DIGITS, MINOR_NUMBER_EXPONENT_MARKER, MINOR_NUMBER_FRACTION_DIGITS, MINOR_NUMBER_INTEGER_DIGITS, MINOR_NUMBER_MINUS, MINOR_NUMBER_MINUSZERO, MINOR_NUMBER_PLUS, MINOR_NUMBER_ZERO, MINOR_ROOT_BOM, MINOR_ROOT_GOT_SEPARATOR, MINOR_ROOT_NEED_SEPARATOR, MINOR_VALUE_APOS_STRING, MINOR_VALUE_EXPECTING_COLON, MINOR_VALUE_EXPECTING_COMMA, MINOR_VALUE_LEADING_WS, MINOR_VALUE_STRING, MINOR_VALUE_STRING_ESCAPE, MINOR_VALUE_STRING_UTF8_2, MINOR_VALUE_STRING_UTF8_3, MINOR_VALUE_STRING_UTF8_4, MINOR_VALUE_TOKEN_ERROR, MINOR_VALUE_TOKEN_FALSE, MINOR_VALUE_TOKEN_NON_STD, MINOR_VALUE_TOKEN_NULL, MINOR_VALUE_TOKEN_TRUE, MINOR_VALUE_WS_AFTER_COMMA, NON_STD_TOKEN_INFINITY, NON_STD_TOKEN_MINUS_INFINITY, NON_STD_TOKEN_NAN, NON_STD_TOKEN_PLUS_INFINITY, NON_STD_TOKEN_VALUES, NON_STD_TOKENS
-
Fields inherited from class com.fasterxml.jackson.core.base.ParserBase
_binaryValue, _byteArrayBuilder, _closed, _currInputProcessed, _currInputRow, _currInputRowStart, _expLength, _fractLength, _inputEnd, _inputPtr, _intLength, _ioContext, _nameCopied, _nameCopyBuffer, _nextToken, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberLong, _numberNegative, _numberString, _numTypesValid, _parsingContext, _streamReadConstraints, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotal, JSON_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
-
Fields inherited from class com.fasterxml.jackson.core.JsonParser
_features, _requestPayload, DEFAULT_READ_CAPABILITIES
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNonBlockingUtf8JsonParserBase(IOContext ctxt, int parserFeatures, ByteQuadsCanonicalizer sym)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected char_decodeEscaped()Method that sub-classes must implement to support escaped sequences in base64-encoded sections.protected JsonToken_finishErrorToken()protected JsonToken_finishErrorTokenWithEOF()protected JsonToken_finishFieldWithEscape()protected JsonToken_finishFloatExponent(boolean checkSign, int ch)protected JsonToken_finishFloatFraction()protected JsonToken_finishKeywordToken(String expToken, int matched, JsonToken result)protected JsonToken_finishKeywordTokenWithEOF(String expToken, int matched, JsonToken result)protected JsonToken_finishNonStdToken(int type, int matched)protected JsonToken_finishNonStdTokenWithEOF(int type, int matched)protected JsonToken_finishNumberIntegralPart(char[] outBuf, int outPtr)protected JsonToken_finishNumberLeadingNegZeroes()protected JsonToken_finishNumberLeadingPosNegZeroes(boolean negative)protected JsonToken_finishNumberLeadingPosZeroes()protected JsonToken_finishNumberLeadingZeroes()protected JsonToken_finishNumberMinus(int ch)protected JsonToken_finishNumberPlus(int ch)protected JsonToken_finishNumberPlusMinus(int ch, boolean negative)protected JsonToken_finishToken()Method called when decoding of a token has been started, but not yet completed due to missing input; method is to continue decoding due to at least one more byte being made available to decode.protected JsonToken_finishTokenWithEOF()Method similar to_finishToken(), but called when no more input is available, and end-of-input has been detected.protected JsonToken_reportErrorToken(String actualToken)protected JsonToken_startAposString()protected JsonToken_startFalseToken()protected JsonToken_startFloat(char[] outBuf, int outPtr, int ch)protected JsonToken_startFloatThatStartsWithPeriod()protected JsonToken_startNegativeNumber()protected JsonToken_startNullToken()protected JsonToken_startNumberLeadingZero()protected JsonToken_startPositiveNumber()protected JsonToken_startPositiveNumber(int ch)protected JsonToken_startString()protected JsonToken_startTrueToken()protected JsonToken_startUnexpectedValue(boolean leadingComma, int ch)voidendOfInput()protected abstract bytegetByteFromBuffer(int ptr)protected abstract bytegetNextSignedByteFromBuffer()protected abstract intgetNextUnsignedByteFromBuffer()booleanneedMoreInput()JsonTokennextToken()Main iteration method, which will advance stream enough to determine type of the next token, if any.-
Methods inherited from class com.fasterxml.jackson.core.json.async.NonBlockingJsonParserBase
_addName, _closeArrayScope, _closeInput, _closeObjectScope, _eofAsNextToken, _fieldComplete, _findName, _findName, _findName, _getText2, _nonStdToken, _padLastQuad, _releaseBuffers, _reportInvalidChar, _reportInvalidInitial, _reportInvalidOther, _reportInvalidOther, _startArrayScope, _startObjectScope, _updateTokenLocation, _valueComplete, _valueCompleteInt, _valueNonStdNumberComplete, canParseAsync, getBinaryValue, getCodec, getCurrentLocation, getEmbeddedObject, getInputSource, getReadCapabilities, getText, getText, getTextCharacters, getTextLength, getTextOffset, getTokenLocation, getValueAsString, getValueAsString, hasTextCharacters, readBinaryValue, releaseBuffered, setCodec, symbolTableForTests
-
Methods inherited from class com.fasterxml.jackson.core.base.ParserBase
_checkStdFeatureChanges, _contentReference, _convertBigDecimalToBigInteger, _decodeBase64Escape, _decodeBase64Escape, _eofAsNextChar, _finishString, _getBigDecimal, _getBigInteger, _getByteArrayBuilder, _getNumberDouble, _getNumberFloat, _getSourceReference, _handleBase64MissingPadding, _handleEOF, _handleUnrecognizedCharacterEscape, _parseIntValue, _parseNumericValue, _reportMismatchedEndMarker, _reportTooLongIntegral, _throwUnquotedSpace, _validJsonTokenList, _validJsonValueList, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, createChildArrayContext, createChildObjectContext, disable, enable, getBigIntegerValue, getCurrentName, getCurrentValue, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, getNumberValueDeferred, getNumberValueExact, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, growArrayBy, isClosed, isNaN, loadMore, loadMoreGuaranteed, overrideCurrentName, overrideStdFeatures, reportInvalidBase64Char, reportInvalidBase64Char, reset, resetAsNaN, resetFloat, resetInt, setCurrentValue, setFeatureMask, streamReadConstraints, version
-
Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
_ascii, _asciiBytes, _constructError, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidEOFInValue, _reportMissingRootWS, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _throwInvalidSpace, _wrapError, clearCurrentToken, currentToken, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, hasCurrentToken, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, 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, _reportUnsupportedOperation, assignCurrentValue, canReadObjectId, canReadTypeId, canUseSchema, configure, currentLocation, currentName, currentTokenLocation, currentValue, finishToken, getBinaryValue, getBooleanValue, getByteValue, getFeatureMask, getFormatFeatures, getNonBlockingInputFeeder, getObjectId, getSchema, getShortValue, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, overrideFormatFeatures, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, requiresCustomCodec, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchema
-
-
-
-
Field Detail
-
_icLatin1
protected static final int[] _icLatin1
-
_origBufferLen
protected int _origBufferLen
In addition to current buffer pointer, and end pointer, we will also need to know number of bytes originally contained. This is needed to correctly update location information when the block has been completed.
-
-
Constructor Detail
-
NonBlockingUtf8JsonParserBase
protected NonBlockingUtf8JsonParserBase(IOContext ctxt, int parserFeatures, ByteQuadsCanonicalizer sym)
-
-
Method Detail
-
needMoreInput
public final boolean needMoreInput()
-
endOfInput
public void endOfInput()
-
_decodeEscaped
protected char _decodeEscaped() throws IOExceptionDescription copied from class:ParserBaseMethod that sub-classes must implement to support escaped sequences in base64-encoded sections. Sub-classes that do not need base64 support can leave this as is- Overrides:
_decodeEscapedin classParserBase- Returns:
- Character decoded, if any
- Throws:
IOException- If escape decoding fails
-
nextToken
public JsonToken nextToken() throws IOException
Description copied from class:JsonParserMain iteration method, which will advance stream enough to determine type of the next token, if any. If none remaining (stream has no content other than possible white space before ending), null will be returned.- Specified by:
nextTokenin classParserMinimalBase- Returns:
- Next token from the stream, if any found, or null to indicate end-of-input
- Throws:
IOException- for low-level read issues, orJsonParseExceptionfor decoding problems
-
getNextSignedByteFromBuffer
protected abstract byte getNextSignedByteFromBuffer()
- Returns:
- next signed byte from the buffer
- Since:
- v2.14
-
getNextUnsignedByteFromBuffer
protected abstract int getNextUnsignedByteFromBuffer()
- Returns:
- next unsigned byte from the buffer
- Since:
- v2.14
-
getByteFromBuffer
protected abstract byte getByteFromBuffer(int ptr)
- Parameters:
ptr- pointer to byte that is required- Returns:
- byte from the buffer at the given pointer
- Since:
- v2.14
-
_finishToken
protected final JsonToken _finishToken() throws IOException
Method called when decoding of a token has been started, but not yet completed due to missing input; method is to continue decoding due to at least one more byte being made available to decode.- Returns:
- Token decoded, if complete;
JsonToken.NOT_AVAILABLEif not - Throws:
IOException- (generallyJsonParseException) for decoding problems
-
_finishTokenWithEOF
protected final JsonToken _finishTokenWithEOF() throws IOException
Method similar to_finishToken(), but called when no more input is available, and end-of-input has been detected. This is usually problem case, but not always: root-level values may be properly terminated by this, and similarly trailing white-space may have been skipped.- Returns:
- Token decoded, if complete;
JsonToken.NOT_AVAILABLEif not - Throws:
IOException- (generallyJsonParseException) for decoding problems
-
_startUnexpectedValue
protected JsonToken _startUnexpectedValue(boolean leadingComma, int ch) throws IOException
- Throws:
IOException
-
_startFalseToken
protected JsonToken _startFalseToken() throws IOException
- Throws:
IOException
-
_startTrueToken
protected JsonToken _startTrueToken() throws IOException
- Throws:
IOException
-
_startNullToken
protected JsonToken _startNullToken() throws IOException
- Throws:
IOException
-
_finishKeywordToken
protected JsonToken _finishKeywordToken(String expToken, int matched, JsonToken result) throws IOException
- Throws:
IOException
-
_finishKeywordTokenWithEOF
protected JsonToken _finishKeywordTokenWithEOF(String expToken, int matched, JsonToken result) throws IOException
- Throws:
IOException
-
_finishNonStdToken
protected JsonToken _finishNonStdToken(int type, int matched) throws IOException
- Throws:
IOException
-
_finishNonStdTokenWithEOF
protected JsonToken _finishNonStdTokenWithEOF(int type, int matched) throws IOException
- Throws:
IOException
-
_finishErrorToken
protected JsonToken _finishErrorToken() throws IOException
- Throws:
IOException
-
_finishErrorTokenWithEOF
protected JsonToken _finishErrorTokenWithEOF() throws IOException
- Throws:
IOException
-
_reportErrorToken
protected JsonToken _reportErrorToken(String actualToken) throws IOException
- Throws:
IOException
-
_startFloatThatStartsWithPeriod
protected JsonToken _startFloatThatStartsWithPeriod() throws IOException
- Throws:
IOException
-
_startPositiveNumber
protected JsonToken _startPositiveNumber(int ch) throws IOException
- Throws:
IOException
-
_startNegativeNumber
protected JsonToken _startNegativeNumber() throws IOException
- Throws:
IOException
-
_startPositiveNumber
protected JsonToken _startPositiveNumber() throws IOException
- Throws:
IOException
-
_startNumberLeadingZero
protected JsonToken _startNumberLeadingZero() throws IOException
- Throws:
IOException
-
_finishNumberMinus
protected JsonToken _finishNumberMinus(int ch) throws IOException
- Throws:
IOException
-
_finishNumberPlus
protected JsonToken _finishNumberPlus(int ch) throws IOException
- Throws:
IOException
-
_finishNumberPlusMinus
protected JsonToken _finishNumberPlusMinus(int ch, boolean negative) throws IOException
- Throws:
IOException
-
_finishNumberLeadingZeroes
protected JsonToken _finishNumberLeadingZeroes() throws IOException
- Throws:
IOException
-
_finishNumberLeadingNegZeroes
protected JsonToken _finishNumberLeadingNegZeroes() throws IOException
- Throws:
IOException
-
_finishNumberLeadingPosZeroes
protected JsonToken _finishNumberLeadingPosZeroes() throws IOException
- Throws:
IOException
-
_finishNumberLeadingPosNegZeroes
protected JsonToken _finishNumberLeadingPosNegZeroes(boolean negative) throws IOException
- Throws:
IOException
-
_finishNumberIntegralPart
protected JsonToken _finishNumberIntegralPart(char[] outBuf, int outPtr) throws IOException
- Throws:
IOException
-
_startFloat
protected JsonToken _startFloat(char[] outBuf, int outPtr, int ch) throws IOException
- Throws:
IOException
-
_finishFloatFraction
protected JsonToken _finishFloatFraction() throws IOException
- Throws:
IOException
-
_finishFloatExponent
protected JsonToken _finishFloatExponent(boolean checkSign, int ch) throws IOException
- Throws:
IOException
-
_finishFieldWithEscape
protected final JsonToken _finishFieldWithEscape() throws IOException
- Throws:
IOException
-
_startString
protected JsonToken _startString() throws IOException
- Throws:
IOException
-
_startAposString
protected JsonToken _startAposString() throws IOException
- Throws:
IOException
-
-