Module tools.jackson.core
Package tools.jackson.core.json
Class UTF8DataInputWithDocLengthJsonParser
java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
tools.jackson.core.base.ParserBase
tools.jackson.core.json.JsonParserBase
tools.jackson.core.json.UTF8DataInputJsonParser
tools.jackson.core.json.UTF8DataInputWithDocLengthJsonParser
- All Implemented Interfaces:
Closeable,AutoCloseable,Versioned
Specialization of
UTF8DataInputJsonParser that tracks the number of
bytes read and enforces the
StreamReadConstraints.getMaxDocumentLength() limit.
Byte tracking is achieved by overriding readUnsignedByte(): every
call increments _bytesRead so that validation can be performed at
token boundaries in nextToken().
- Since:
- 3.2
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.core.JsonParser
JsonParser.NumberType, JsonParser.NumberTypeFP -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longRunning total of bytes read fromUTF8DataInputJsonParser._inputData.Fields inherited from class tools.jackson.core.json.UTF8DataInputJsonParser
_icLatin1, _inputData, _nextByte, _quadBuffer, _symbols, _tokenIncompleteFields inherited from class tools.jackson.core.json.JsonParserBase
_formatReadFeatures, _nameCopied, _nextToken, _numberIsHex, _streamReadContextFields inherited from class tools.jackson.core.base.ParserBase
_binaryValue, _byteArrayBuilder, _currInputProcessed, _currInputRow, _currInputRowStart, _expLength, _fractLength, _inputEnd, _inputPtr, _intLength, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberIsNaN, _numberLong, _numberNegative, _numberString, _numTypesValid, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotalFields 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
ConstructorsConstructorDescriptionUTF8DataInputWithDocLengthJsonParser(ObjectReadContext readCtxt, IOContext ctxt, int stdFeatures, int formatFeatures, DataInput inputData, ByteQuadsCanonicalizer sym, int firstByte) -
Method Summary
Modifier and TypeMethodDescriptionMain iteration method, which will advance stream enough to determine type of the next token, if any.protected intRead the next unsigned byte from the input.Methods inherited from class tools.jackson.core.json.UTF8DataInputJsonParser
_closeInput, _currentLocationMinusOne, _decodeBase64, _decodeCharForError, _decodeEscaped, _finishString, _getText2, _handleApos, _handleInvalidNumberStart, _handleInvalidNumberStart, _handleOddName, _handleUnexpectedValue, _matchToken, _parseAposName, _parseFloatThatStartsWithPeriod, _parseName, _parseNegNumber, _parsePosNumber, _parseUnsignedNumber, _readBinary, _releaseBuffers, _reportInvalidChar, _reportInvalidInitial, _reportInvalidToken, _reportInvalidToken, _skipString, currentLocation, currentTokenLocation, finishToken, getBinaryValue, getString, getString, getStringCharacters, getStringLength, getStringOffset, getValueAsInt, getValueAsInt, getValueAsString, getValueAsString, nextBooleanValue, nextIntValue, nextLongValue, nextName, nextStringValue, parseEscapedName, readBinaryValue, readString, releaseBuffered, streamReadInputSource, willInternPropertyNamesMethods inherited from class tools.jackson.core.json.JsonParserBase
_bufferForStringStreaming, _checkHexNumbersAllowed, _decodeSurrogate, _handleUnrecognizedCharacterEscape, _hexPrefixNotFollowedMessage, _isAllowedCtrlCharRS, _parseIntValue, _parseNumericValue, _reportExtraEndMarker, _reportMismatchedEndMarker, _reportTooLongIntegral, _reportUnexpectedLowSurrogate, _throwUnquotedSpace, _validJsonTokenList, _validJsonValueList, assignCurrentValue, createChildArrayContext, createChildObjectContext, currentName, currentNameInBuffer, currentValue, hasStringCharacters, isEnabled, resetInt, resetIntHex, streamReadCapabilities, streamReadContext, versionMethods inherited from class tools.jackson.core.base.ParserBase
_contentReference, _contentReferenceRedacted, _convertBigDecimalToBigInteger, _decodeBase64Escape, _decodeBase64Escape, _eofAsNextChar, _getBigDecimal, _getBigInteger, _getByteArrayBuilder, _getNumberDouble, _getNumberFloat, _growNameDecodeBuffer, _handleBase64MissingPadding, _handleEOF, _reportInvalidBase64Char, _reportInvalidBase64Char, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, getBigIntegerValue, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, getNumberValueDeferred, getNumberValueExact, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, growArrayBy, isNaN, reset, resetAsNaN, resetFloatMethods inherited from class tools.jackson.core.base.ParserMinimalBase
_constructInputCoercion, _constructNotNumericType, _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, getBooleanValue, getByteValue, getEmbeddedObject, getLastClearedToken, getNumberTypeFP, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsLong, getValueAsLong, hasCurrentToken, hasToken, hasTokenId, isClosed, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, 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, canParseAsync, canReadObjectId, canReadTypeId, getBinaryValue, getObjectId, getSchema, getText, getTextCharacters, getTextLength, getTextOffset, getTypeId, getValueAsBoolean, getValueAsDouble, nonBlockingInputFeeder, readBinaryValue, releaseBuffered
-
Field Details
-
_bytesRead
protected long _bytesReadRunning total of bytes read fromUTF8DataInputJsonParser._inputData.
-
-
Constructor Details
-
UTF8DataInputWithDocLengthJsonParser
public UTF8DataInputWithDocLengthJsonParser(ObjectReadContext readCtxt, IOContext ctxt, int stdFeatures, int formatFeatures, DataInput inputData, ByteQuadsCanonicalizer sym, int firstByte)
-
-
Method Details
-
readUnsignedByte
Description copied from class:UTF8DataInputJsonParserRead the next unsigned byte from the input. Subclasses may override to track byte counts for document length enforcement.- Overrides:
readUnsignedBytein classUTF8DataInputJsonParser- Throws:
IOException
-
nextToken
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.- Overrides:
nextTokenin classUTF8DataInputJsonParser- Returns:
- Next token from the stream, if any found, or null to indicate end-of-input
- Throws:
JacksonException- for low-level read issues
-