Package com.fasterxml.jackson.core.json
Class JsonParserBase
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.JsonParserBase
- All Implemented Interfaces:
Versioned,Closeable,AutoCloseable
- Direct Known Subclasses:
NonBlockingJsonParserBase,ReaderBasedJsonParser,UTF8DataInputJsonParser,UTF8StreamJsonParser
Another intermediate base class, only used by actual JSON-backed parser
implementations.
- Since:
- 2.17
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonParser
JsonParser.Feature, JsonParser.NumberType, JsonParser.NumberTypeFP -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ObjectCodecCodec used for data binding when (if) requested; typically fullObjectMapper, but that abstract is not part of core package.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 int[]protected static final int[]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, _numberIsNaN, _numberLong, _numberNegative, _numberString, _numTypesValid, _parsingContext, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotal, JSON_READ_CAPABILITIESFields inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
_currToken, _lastClearedToken, _streamReadConstraints, _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_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_UNKNOWNFields inherited from class com.fasterxml.jackson.core.JsonParser
_features, _requestPayload, DEFAULT_READ_CAPABILITIES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJsonParserBase(IOContext ioCtxt, int features, ObjectCodec codec) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract JsonLocationFactory method used to provide location for cases where we must read and consume a single "wrong" character (to possibly allow error recovery), but need to report accurate location for that character: if so, the current location is past location we want, and location we want will be "one location earlier".abstract JsonLocationMethod that returns location of the last processed input unit (character or byte) from the input; usually for error reporting purposes.abstract JsonLocationMethod that return the starting location of the current (most recently returned) token; that is, the position of the first input unit (character or byte) from input that starts the current token.getCodec()Accessor forObjectCodecassociated with this parser, if any.final JsonLocationDeprecated.JSON format does not have native information on "correct" floating-point type to use, unlike some formats (most binary formats), so it needs to indicate this asJsonParser.NumberTypeFP.UNKNOWN.Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly).final JsonLocationDeprecated.voidSetter that allows definingObjectCodecassociated with this parser, if any.Methods inherited from class com.fasterxml.jackson.core.base.ParserBase
_checkStdFeatureChanges, _closeInput, _contentReference, _contentReferenceRedacted, _convertBigDecimalToBigInteger, _decodeBase64Escape, _decodeBase64Escape, _decodeEscaped, _eofAsNextChar, _finishString, _getBigDecimal, _getBigInteger, _getByteArrayBuilder, _getNumberDouble, _getNumberFloat, _getSourceReference, _growNameDecodeBuffer, _handleBase64MissingPadding, _handleEOF, _handleUnrecognizedCharacterEscape, _parseIntValue, _parseNumericValue, _releaseBuffers, _reportMismatchedEndMarker, _reportTooLongIntegral, _throwUnquotedSpace, _validJsonTokenList, _validJsonValueList, assignCurrentValue, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, createChildArrayContext, createChildObjectContext, currentValue, disable, enable, getBigIntegerValue, getBinaryValue, getCurrentName, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, getNumberValueDeferred, getNumberValueExact, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, growArrayBy, hasTextCharacters, isClosed, isNaN, loadMore, loadMoreGuaranteed, overrideCurrentName, overrideStdFeatures, reportInvalidBase64Char, reportInvalidBase64Char, reset, resetAsNaN, resetFloat, resetInt, setFeatureMask, versionMethods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
_ascii, _asciiBytes, _constructError, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportMissingRootWS, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _throwInternalReturnAny, _throwInvalidSpace, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapError, clearCurrentToken, currentToken, currentTokenCount, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getText, getTextCharacters, getTextLength, getTextOffset, 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, streamReadConstraintsMethods inherited from class com.fasterxml.jackson.core.JsonParser
_codec, _constructError, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, canParseAsync, canReadObjectId, canReadTypeId, canUseSchema, configure, currentName, finishToken, getBinaryValue, getBooleanValue, getByteValue, getCurrentValue, getEmbeddedObject, getFeatureMask, getFormatFeatures, getInputSource, getNonBlockingInputFeeder, getObjectId, getSchema, getShortValue, getText, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, overrideFormatFeatures, readBinaryValue, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, releaseBuffered, requiresCustomCodec, setCurrentValue, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchema
-
Field Details
-
FEAT_MASK_TRAILING_COMMA
protected static final int FEAT_MASK_TRAILING_COMMA -
FEAT_MASK_LEADING_ZEROS
protected static final int FEAT_MASK_LEADING_ZEROS -
FEAT_MASK_NON_NUM_NUMBERS
protected static final int FEAT_MASK_NON_NUM_NUMBERS -
FEAT_MASK_ALLOW_MISSING
protected static final int FEAT_MASK_ALLOW_MISSING -
FEAT_MASK_ALLOW_SINGLE_QUOTES
protected static final int FEAT_MASK_ALLOW_SINGLE_QUOTES -
FEAT_MASK_ALLOW_UNQUOTED_NAMES
protected static final int FEAT_MASK_ALLOW_UNQUOTED_NAMES -
FEAT_MASK_ALLOW_JAVA_COMMENTS
protected static final int FEAT_MASK_ALLOW_JAVA_COMMENTS -
FEAT_MASK_ALLOW_YAML_COMMENTS
protected static final int FEAT_MASK_ALLOW_YAML_COMMENTS -
INPUT_CODES_LATIN1
protected static final int[] INPUT_CODES_LATIN1 -
INPUT_CODES_UTF8
protected static final int[] INPUT_CODES_UTF8 -
_objectCodec
Codec used for data binding when (if) requested; typically fullObjectMapper, but that abstract is not part of core package.
-
-
Constructor Details
-
JsonParserBase
-
-
Method Details
-
getCodec
Description copied from class:JsonParserAccessor forObjectCodecassociated with this parser, if any. Codec is used byJsonParser.readValueAs(Class)method (and its variants).- Specified by:
getCodecin classJsonParser- Returns:
- Codec assigned to this parser, if any;
nullif none
-
setCodec
Description copied from class:JsonParserSetter that allows definingObjectCodecassociated with this parser, if any. Codec is used byJsonParser.readValueAs(Class)method (and its variants).- Specified by:
setCodecin classJsonParser- Parameters:
c- Codec to assign, if any;nullif none
-
getReadCapabilities
Description copied from class:JsonParserAccessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly).- Overrides:
getReadCapabilitiesin classJsonParser- Returns:
- Set of read capabilities for content to read via this parser
-
getNumberTypeFP
JSON format does not have native information on "correct" floating-point type to use, unlike some formats (most binary formats), so it needs to indicate this asJsonParser.NumberTypeFP.UNKNOWN.- Overrides:
getNumberTypeFPin classJsonParser- Returns:
- Natural floating-point type if known;
JsonParser.NumberTypeFP.UNKNOWNfor all JSON-backed parsers. - Throws:
IOException- for low-level read issues, orJsonParseExceptionfor decoding problems
-
currentLocation
Description copied from class:JsonParserMethod that returns location of the last processed input unit (character or byte) from the input; usually for error reporting purposes.Note that the location is not guaranteed to be accurate (although most implementation will try their best): some implementations may only report specific boundary locations (start or end locations of tokens) and others only return
JsonLocation.NAdue to not having access to input location information (when delegating actual decoding work to other library)- Overrides:
currentLocationin classJsonParser- Returns:
- Location of the last processed input unit (byte or character)
-
currentTokenLocation
Description copied from class:JsonParserMethod that return the starting location of the current (most recently returned) token; that is, the position of the first input unit (character or byte) from input that starts the current token.Note that the location is not guaranteed to be accurate (although most implementation will try their best): some implementations may only return
JsonLocation.NAdue to not having access to input location information (when delegating actual decoding work to other library)- Overrides:
currentTokenLocationin classJsonParser- Returns:
- Starting location of the token parser currently points to
-
_currentLocationMinusOne
Description copied from class:ParserMinimalBaseFactory method used to provide location for cases where we must read and consume a single "wrong" character (to possibly allow error recovery), but need to report accurate location for that character: if so, the current location is past location we want, and location we want will be "one location earlier".Default implementation simply returns
JsonParser.currentLocation()- Overrides:
_currentLocationMinusOnein classParserMinimalBase- Returns:
- Same as
JsonParser.currentLocation()except offset by -1
-
getCurrentLocation
Deprecated.Description copied from class:ParserBaseMethod that returns location of the last processed character; usually for error reporting purposes- Overrides:
getCurrentLocationin classParserBase- Returns:
- Location of the last processed input unit (byte or character)
-
getTokenLocation
Deprecated.Description copied from class:ParserBaseMethod that return the starting location of the current token; that is, position of the first character from input that starts the current token.- Overrides:
getTokenLocationin classParserBase- Returns:
- Starting location of the token parser currently points to
-