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
,java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
NonBlockingJsonParserBase
,ReaderBasedJsonParser
,UTF8DataInputJsonParser
,UTF8StreamJsonParser
public abstract class JsonParserBase extends ParserBase
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract JsonLocation
currentLocation()
Method that returns location of the last processed input unit (character or byte) from the input; usually for error reporting purposes.abstract JsonLocation
currentTokenLocation()
Method 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.ObjectCodec
getCodec()
Accessor forObjectCodec
associated with this parser, if any.JsonLocation
getCurrentLocation()
Deprecated.JsonParser.NumberTypeFP
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
.JacksonFeatureSet<StreamReadCapability>
getReadCapabilities()
Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly).JsonLocation
getTokenLocation()
Deprecated.void
setCodec(ObjectCodec c)
Setter that allows definingObjectCodec
associated with this parser, if any.-
Methods inherited from class com.fasterxml.jackson.core.base.ParserBase
_getByteArrayBuilder, assignCurrentValue, close, currentValue, disable, enable, getBigIntegerValue, getBinaryValue, getCurrentName, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, getNumberValueDeferred, getNumberValueExact, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, hasTextCharacters, isClosed, isNaN, overrideCurrentName, overrideStdFeatures, setFeatureMask, streamReadConstraints, version
-
Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
clearCurrentToken, currentToken, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getText, getTextCharacters, getTextLength, getTextOffset, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextToken, nextValue, skipChildren
-
Methods inherited from class com.fasterxml.jackson.core.JsonParser
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
-
-
-
-
Method Detail
-
getCodec
public ObjectCodec getCodec()
Description copied from class:JsonParser
Accessor forObjectCodec
associated with this parser, if any. Codec is used byJsonParser.readValueAs(Class)
method (and its variants).- Specified by:
getCodec
in classJsonParser
- Returns:
- Codec assigned to this parser, if any;
null
if none
-
setCodec
public void setCodec(ObjectCodec c)
Description copied from class:JsonParser
Setter that allows definingObjectCodec
associated with this parser, if any. Codec is used byJsonParser.readValueAs(Class)
method (and its variants).- Specified by:
setCodec
in classJsonParser
- Parameters:
c
- Codec to assign, if any;null
if none
-
getReadCapabilities
public final JacksonFeatureSet<StreamReadCapability> getReadCapabilities()
Description copied from class:JsonParser
Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly).- Overrides:
getReadCapabilities
in classJsonParser
- Returns:
- Set of read capabilities for content to read via this parser
-
getNumberTypeFP
public JsonParser.NumberTypeFP getNumberTypeFP() throws java.io.IOException
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:
getNumberTypeFP
in classJsonParser
- Returns:
- Natural floating-point type if known;
JsonParser.NumberTypeFP.UNKNOWN
for all JSON-backed parsers. - Throws:
java.io.IOException
- for low-level read issues, orJsonParseException
for decoding problems
-
currentLocation
public abstract JsonLocation currentLocation()
Description copied from class:JsonParser
Method 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.NA
due to not having access to input location information (when delegating actual decoding work to other library)- Overrides:
currentLocation
in classJsonParser
- Returns:
- Location of the last processed input unit (byte or character)
-
currentTokenLocation
public abstract JsonLocation currentTokenLocation()
Description copied from class:JsonParser
Method 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.NA
due to not having access to input location information (when delegating actual decoding work to other library)- Overrides:
currentTokenLocation
in classJsonParser
- Returns:
- Starting location of the token parser currently points to
-
getCurrentLocation
@Deprecated public final JsonLocation getCurrentLocation()
Deprecated.Description copied from class:ParserBase
Method that returns location of the last processed character; usually for error reporting purposes- Overrides:
getCurrentLocation
in classParserBase
- Returns:
- Location of the last processed input unit (byte or character)
-
getTokenLocation
@Deprecated public final JsonLocation getTokenLocation()
Deprecated.Description copied from class:ParserBase
Method that return the starting location of the current token; that is, position of the first character from input that starts the current token.- Overrides:
getTokenLocation
in classParserBase
- Returns:
- Starting location of the token parser currently points to
-
-