Top Description Fields Constructors Methods
com.fasterxml.jackson.core.util

public Class JsonParserDelegate

extends JsonParser
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.core.util.JsonParserSequence, com.fasterxml.jackson.core.filter.FilteringParserDelegate
Imports
java.io.IOException, .OutputStream, .Writer, java.math.BigDecimal, .BigInteger, com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.async.NonBlockingInputFeeder

Helper class that implements delegation pattern for JsonParser, to allow for simple overridability of basic parsing functionality. The idea is that any functionality to be modified can be simply overridden; and anything else will be delegated by default.

Field Summary

Modifier and TypeField and Description
protected JsonParser
delegate

Delegate object that method calls are delegated to.

Inherited from com.fasterxml.jackson.core.JsonParser:
_features_requestPayloadDEFAULT_READ_CAPABILITIES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
assignCurrentValue(Object
Current value to assign for the current input context of this parser
v
)

Overrides com.fasterxml.jackson.core.JsonParser.assignCurrentValue.

Helper method, usually equivalent to: getParsingContext().setCurrentValue(v);

public boolean
canParseAsync()

Overrides com.fasterxml.jackson.core.JsonParser.canParseAsync.

Method that can be called to determine if this parser instance uses non-blocking ("asynchronous") input access for decoding or not.

public boolean
canReadObjectId()

Overrides com.fasterxml.jackson.core.JsonParser.canReadObjectId.

Introspection method that may be called to see if the underlying data format supports some kind of Object Ids natively (many do not; for example, JSON doesn't).

public boolean
canReadTypeId()

Overrides com.fasterxml.jackson.core.JsonParser.canReadTypeId.

Introspection method that may be called to see if the underlying data format supports some kind of Type Ids natively (many do not; for example, JSON doesn't).

public boolean
canUseSchema(FormatSchema
Schema to check
schema
)

Overrides com.fasterxml.jackson.core.JsonParser.canUseSchema.

Method that can be used to verify that given schema can be used with this parser (using setSchema).

public void
clearCurrentToken()

Implements abstract com.fasterxml.jackson.core.JsonParser.clearCurrentToken.

Method called to "consume" the current token by effectively removing it so that hasCurrentToken returns false, and getCurrentToken null).

public void
close()

Implements abstract com.fasterxml.jackson.core.JsonParser.close.

Implements java.io.Closeable.close.

Closes the parser so that no further iteration or data access can be made; will also close the underlying input source if parser either owns the input source, or feature Feature#AUTO_CLOSE_SOURCE is enabled.

public JsonLocation
currentLocation()

Overrides com.fasterxml.jackson.core.JsonParser.currentLocation.

Method that returns location of the last processed input unit (character or byte) from the input; usually for error reporting purposes.

public String
currentName()

Overrides com.fasterxml.jackson.core.JsonParser.currentName.

Method that can be called to get the name associated with the current token: for JsonToken#FIELD_NAMEs it will be the same as what getText returns; for field values it will be preceding field name; and for others (array values, root-level values) null.

public JsonToken
currentToken()

Overrides com.fasterxml.jackson.core.JsonParser.currentToken.

Accessor to find which token parser currently points to, if any; null will be returned if none.

public long
currentTokenCount()

Overrides com.fasterxml.jackson.core.JsonParser.currentTokenCount.

Get an approximate count of the number of tokens that have been read.

public int
currentTokenId()

Overrides com.fasterxml.jackson.core.JsonParser.currentTokenId.

Method similar to getCurrentToken() but that returns an int instead of JsonToken (enum value).

public JsonLocation
currentTokenLocation()

Overrides com.fasterxml.jackson.core.JsonParser.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.

public Object
currentValue()

Overrides com.fasterxml.jackson.core.JsonParser.currentValue.

Helper method, usually equivalent to: getParsingContext().getCurrentValue();

Note that "current value" is NOT populated (or used) by Streaming parser; it is only used by higher-level data-binding functionality.

public JsonParser

Returns:

Underlying parser calls are delegated to
delegate
()

Accessor for getting the immediate JsonParser this parser delegates calls to.

public JsonParser
disable(JsonParser.Feature
Feature to disable
f
)

Overrides com.fasterxml.jackson.core.JsonParser.disable.

Method for disabling specified feature (check Feature for list of features)

public JsonParser
enable(JsonParser.Feature
Feature to enable
f
)

Overrides com.fasterxml.jackson.core.JsonParser.enable.

Method for enabling specified parser feature (check Feature for list of features)

public void
finishToken()

Overrides com.fasterxml.jackson.core.JsonParser.finishToken.

Method that may be used to force full handling of the current token so that even if lazy processing is enabled, the whole contents are read for possible retrieval.

public BigInteger
getBigIntegerValue()

Implements abstract com.fasterxml.jackson.core.JsonParser.getBigIntegerValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can not be used as a Java long primitive type due to its magnitude.

public byte[]
getBinaryValue(Base64Variant
Expected variant of base64 encoded content (see Base64Variants for definitions of "standard" variants).
b64variant
)

Implements abstract com.fasterxml.jackson.core.JsonParser.getBinaryValue.

Method that can be used to read (and consume -- results may not be accessible using other methods after the call) base64-encoded binary data included in the current textual JSON value.

public boolean
getBooleanValue()

Overrides com.fasterxml.jackson.core.JsonParser.getBooleanValue.

Convenience accessor that can be called when the current token is JsonToken#VALUE_TRUE or JsonToken#VALUE_FALSE, to return matching boolean value.

public byte
getByteValue()

Overrides com.fasterxml.jackson.core.JsonParser.getByteValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a value of Java byte primitive type.

public ObjectCodec
getCodec()

Implements abstract com.fasterxml.jackson.core.JsonParser.getCodec.

Accessor for ObjectCodec associated with this parser, if any.

public JsonLocation
getCurrentLocation()

Implements abstract com.fasterxml.jackson.core.JsonParser.getCurrentLocation.

Deprecated

Deprecated alias for currentLocation() (removed from Jackson 3.0).

public String
getCurrentName()

Implements abstract com.fasterxml.jackson.core.JsonParser.getCurrentName.

Deprecated

Deprecated alias of currentName().

public JsonToken
getCurrentToken()

Implements abstract com.fasterxml.jackson.core.JsonParser.getCurrentToken.

Deprecated

Alias for currentToken(), may be deprecated sometime after Jackson 2.13 (will be removed from 3.0).

public int
public Object
getCurrentValue()

Overrides com.fasterxml.jackson.core.JsonParser.getCurrentValue.

Deprecated

Deprecated alias for currentValue() (removed from Jackson 3.0).

public BigDecimal
getDecimalValue()

Implements abstract com.fasterxml.jackson.core.JsonParser.getDecimalValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_FLOAT or JsonToken#VALUE_NUMBER_INT.

public double
getDoubleValue()

Implements abstract com.fasterxml.jackson.core.JsonParser.getDoubleValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_FLOAT and it can be expressed as a Java double primitive type.

public Object
getEmbeddedObject()

Overrides com.fasterxml.jackson.core.JsonParser.getEmbeddedObject.

Accessor that can be called if (and only if) the current token is JsonToken#VALUE_EMBEDDED_OBJECT.

public int
getFeatureMask()

Overrides com.fasterxml.jackson.core.JsonParser.getFeatureMask.

Bulk access method for getting state of all standard Features.

public float
getFloatValue()

Implements abstract com.fasterxml.jackson.core.JsonParser.getFloatValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_FLOAT and it can be expressed as a Java float primitive type.

public Object
getInputSource()

Overrides com.fasterxml.jackson.core.JsonParser.getInputSource.

Method that can be used to get access to object that is used to access input being parsed; this is usually either InputStream or Reader, depending on what parser was constructed with.

public int
getIntValue()

Implements abstract com.fasterxml.jackson.core.JsonParser.getIntValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a value of Java int primitive type.

public JsonToken
getLastClearedToken()

Implements abstract com.fasterxml.jackson.core.JsonParser.getLastClearedToken.

Method that can be called to get the last token that was cleared using clearCurrentToken.

public long
getLongValue()

Implements abstract com.fasterxml.jackson.core.JsonParser.getLongValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a Java long primitive type.

public NonBlockingInputFeeder
getNonBlockingInputFeeder()

Overrides com.fasterxml.jackson.core.JsonParser.getNonBlockingInputFeeder.

Method that will either return a feeder instance (if parser uses non-blocking, aka asynchronous access); or null for parsers that use blocking I/O.

public JsonParser.NumberType
getNumberType()

Implements abstract com.fasterxml.jackson.core.JsonParser.getNumberType.

If current token is of type JsonToken#VALUE_NUMBER_INT or JsonToken#VALUE_NUMBER_FLOAT, returns one of NumberType constants; otherwise returns null.

public JsonParser.NumberTypeFP
getNumberTypeFP()

Overrides com.fasterxml.jackson.core.JsonParser.getNumberTypeFP.

If current token is of type JsonToken#VALUE_NUMBER_FLOAT, returns one of NumberTypeFP constants; otherwise returns NumberTypeFP#UNKNOWN.

public Number
getNumberValue()

Implements abstract com.fasterxml.jackson.core.JsonParser.getNumberValue.

Generic number value accessor method that will work for all kinds of numeric values.

public Object
getNumberValueDeferred()

Overrides com.fasterxml.jackson.core.JsonParser.getNumberValueDeferred.

Method similar to getNumberValue but that returns either same Number value as getNumberValue() (if already decoded), or String representation of as-of-yet undecoded number.

public Number
getNumberValueExact()

Overrides com.fasterxml.jackson.core.JsonParser.getNumberValueExact.

Method similar to getNumberValue with the difference that for floating-point numbers value returned may be BigDecimal if the underlying format does not store floating-point numbers using native representation: for example, textual formats represent numbers as Strings (which are 10-based), and conversion to java.lang.Double is potentially lossy operation.

public Object
getObjectId()

Overrides com.fasterxml.jackson.core.JsonParser.getObjectId.

Method that can be called to check whether current token (one that was just read) has an associated Object id, and if so, return it.

public JsonStreamContext
getParsingContext()

Implements abstract com.fasterxml.jackson.core.JsonParser.getParsingContext.

Method that can be used to access current parsing context reader is in. There are 3 different types: root, array and object contexts, with slightly different available information.

public JacksonFeatureSet<StreamReadCapability>
getReadCapabilities()

Overrides com.fasterxml.jackson.core.JsonParser.getReadCapabilities.

Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly).

public FormatSchema
getSchema()

Overrides com.fasterxml.jackson.core.JsonParser.getSchema.

Method for accessing Schema that this parser uses, if any.

public short
getShortValue()

Overrides com.fasterxml.jackson.core.JsonParser.getShortValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a value of Java short primitive type.

public String
getText()

Implements abstract com.fasterxml.jackson.core.JsonParser.getText.

Method for accessing textual representation of the current token; if no current token (before first call to nextToken, or after encountering end-of-input), returns null.

public int
getText(Writer
Writer to write textual content to
writer
)

Overrides com.fasterxml.jackson.core.JsonParser.getText.

Method to read the textual representation of the current token in chunks and pass it to the given Writer.

public char[]
getTextCharacters()

Implements abstract com.fasterxml.jackson.core.JsonParser.getTextCharacters.

Method similar to getText, but that will return underlying (unmodifiable) character array that contains textual value, instead of constructing a String object to contain this information.

public int
getTextLength()

Implements abstract com.fasterxml.jackson.core.JsonParser.getTextLength.

Accessor used with getTextCharacters, to know length of String stored in returned buffer.

public int
getTextOffset()

Implements abstract com.fasterxml.jackson.core.JsonParser.getTextOffset.

Accessor used with getTextCharacters, to know offset of the first text content character within buffer.

public JsonLocation
getTokenLocation()

Implements abstract com.fasterxml.jackson.core.JsonParser.getTokenLocation.

Deprecated

Deprecated alias for currentTokenLocation() (removed from Jackson 3.0).

public Object
getTypeId()

Overrides com.fasterxml.jackson.core.JsonParser.getTypeId.

Method that can be called to check whether current token (one that was just read) has an associated type id, and if so, return it.

public boolean
getValueAsBoolean()

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsBoolean.

Method that will try to convert value of current token to a boolean.

public boolean
getValueAsBoolean(boolean
Default value to return if conversion to boolean is not possible
defaultValue
)

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsBoolean.

Method that will try to convert value of current token to a boolean.

public double
getValueAsDouble()

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsDouble.

Method that will try to convert value of current token to a Java double.

public double
getValueAsDouble(double
Default value to return if conversion to double is not possible
defaultValue
)

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsDouble.

Method that will try to convert value of current token to a Java double.

public int
getValueAsInt()

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsInt.

Method that will try to convert value of current token to a Java int value.

public int
getValueAsInt(int
Default value to return if conversion to int is not possible
defaultValue
)

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsInt.

Method that will try to convert value of current token to a int.

public long
getValueAsLong()

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsLong.

Method that will try to convert value of current token to a long.

public long
getValueAsLong(long
Default value to return if conversion to long is not possible
defaultValue
)

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsLong.

Method that will try to convert value of current token to a long.

public String
getValueAsString()

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsString.

Method that will try to convert value of current token to a java.lang.String.

public String
getValueAsString(String
Default value to return if conversion to String is not possible
defaultValue
)

Implements abstract com.fasterxml.jackson.core.JsonParser.getValueAsString.

Method that will try to convert value of current token to a java.lang.String.

public boolean
hasCurrentToken()

Implements abstract com.fasterxml.jackson.core.JsonParser.hasCurrentToken.

Method for checking whether parser currently points to a token (and data for that token is available).

public boolean
hasTextCharacters()

Implements abstract com.fasterxml.jackson.core.JsonParser.hasTextCharacters.

Method that can be used to determine whether calling of getTextCharacters would be the most efficient way to access textual content for the event parser currently points to.

public boolean
hasToken(JsonToken
Token to match
t
)

Implements abstract com.fasterxml.jackson.core.JsonParser.hasToken.

Method that is functionally equivalent to: return currentToken() == t but may be more efficiently implemented.

public boolean
hasTokenId(int
Token id to match (from (@link JsonTokenId})
id
)

Implements abstract com.fasterxml.jackson.core.JsonParser.hasTokenId.

Method that is functionally equivalent to: return currentTokenId() == id but may be more efficiently implemented.

public boolean
isClosed()

Implements abstract com.fasterxml.jackson.core.JsonParser.isClosed.

Method that can be called to determine whether this parser is closed or not.

public boolean
isEnabled(JsonParser.Feature
Feature to check
f
)

Overrides com.fasterxml.jackson.core.JsonParser.isEnabled.

Method for checking whether specified Feature is enabled.

public boolean
public boolean
isExpectedStartArrayToken()

Overrides com.fasterxml.jackson.core.JsonParser.isExpectedStartArrayToken.

Specialized accessor that can be used to verify that the current token indicates start array (usually meaning that current token is JsonToken#START_ARRAY) when start array is expected.

public boolean
public boolean
isNaN()

Overrides com.fasterxml.jackson.core.JsonParser.isNaN.

Accessor for checking whether current token is a special "not-a-number" (NaN) token (including both "NaN" AND positive/negative infinity!).

public JsonToken
nextToken()

Implements abstract com.fasterxml.jackson.core.JsonParser.nextToken.

Main iteration method, which will advance stream enough to determine type of the next token, if any.

public JsonToken
nextValue()

Implements abstract com.fasterxml.jackson.core.JsonParser.nextValue.

Iteration method that will advance stream enough to determine type of the next token that is a value type (including JSON Array and Object start/end markers).

public void
overrideCurrentName(String
Name to use as the current name; may be null.
name
)

Implements abstract com.fasterxml.jackson.core.JsonParser.overrideCurrentName.

Method that can be used to change what is considered to be the current (field) name.

public JsonParser
overrideFormatFeatures(int
Bit mask of set/clear state for features to change
values
,
int
Bit mask of features to change
mask
)

Overrides com.fasterxml.jackson.core.JsonParser.overrideFormatFeatures.

Bulk set method for (re)setting states of FormatFeatures, by specifying values (set / clear) along with a mask, to determine which features to change, if any.

public JsonParser
overrideStdFeatures(int
Bit mask of set/clear state for features to change
values
,
int
Bit mask of features to change
mask
)

Overrides com.fasterxml.jackson.core.JsonParser.overrideStdFeatures.

Bulk set method for (re)setting states of features specified by mask.

public int
readBinaryValue(Base64Variant
base64 variant to use
b64variant
,
OutputStream
Output stream to use for passing decoded binary data
out
)

Overrides com.fasterxml.jackson.core.JsonParser.readBinaryValue.

Similar to readBinaryValue(OutputStream) but allows explicitly specifying base64 variant to use.

public boolean
requiresCustomCodec()

Overrides com.fasterxml.jackson.core.JsonParser.requiresCustomCodec.

Method that can be called to determine if a custom ObjectCodec is needed for binding data parsed using JsonParser constructed by this factory (which typically also implies the same for serialization with JsonGenerator).

public void
setCodec(ObjectCodec
Codec to assign, if any; null if none
c
)

Implements abstract com.fasterxml.jackson.core.JsonParser.setCodec.

Setter that allows defining ObjectCodec associated with this parser, if any.

public void
setCurrentValue(Object
Current value to assign for the current input context of this parser
v
)

Overrides com.fasterxml.jackson.core.JsonParser.setCurrentValue.

Deprecated

Deprecated alias for assignCurrentValue(Object) (removed from Jackson 3.0).

public JsonParser
setFeatureMask(int
Bit mask that defines set of features to enable
mask
)

Overrides com.fasterxml.jackson.core.JsonParser.setFeatureMask.

Deprecated

Bulk set method for (re)setting states of all standard Features

public void
setSchema(FormatSchema
Schema to use
schema
)

Overrides com.fasterxml.jackson.core.JsonParser.setSchema.

Method to call to make this parser use specified schema.

public JsonParser
skipChildren()

Implements abstract com.fasterxml.jackson.core.JsonParser.skipChildren.

Method that will skip all child tokens of an array or object token that the parser currently points to, if (and only if) stream points to JsonToken#START_OBJECT or JsonToken#START_ARRAY.

public StreamReadConstraints
streamReadConstraints()

Overrides com.fasterxml.jackson.core.JsonParser.streamReadConstraints.

Get the constraints to apply when performing streaming reads.

public Version
version()

Implements abstract com.fasterxml.jackson.core.JsonParser.version.

Implements com.fasterxml.jackson.core.Versioned.version.

Accessor for getting version of the core package, given a parser instance.

Inherited from com.fasterxml.jackson.core.JsonParser:
_codec_constructError_constructReadException_constructReadException_constructReadException_constructReadException_constructReadException_reportUnsupportedOperationconfiguregetBinaryValuegetFormatFeaturesisEnablednextBooleanValuenextFieldNamenextFieldNamenextIntValuenextLongValuenextTextValuereadBinaryValuereadValueAsreadValueAsreadValueAsTreereadValuesAsreadValuesAsreleaseBufferedreleaseBufferedsetRequestPayloadOnErrorsetRequestPayloadOnErrorsetRequestPayloadOnError