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

public abstract Class JsonParser

extends Object
implements Closeable, Versioned
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.core.Versioned, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
com.fasterxml.jackson.core.base.ParserMinimalBase, com.fasterxml.jackson.core.util.JsonParserDelegate
Imports
java.io.*, java.math.BigDecimal, .BigInteger, java.util.Iterator, com.fasterxml.jackson.core.async.NonBlockingInputFeeder, com.fasterxml.jackson.core.exc.InputCoercionException, com.fasterxml.jackson.core.type.TypeReference, com.fasterxml.jackson.core.util.JacksonFeatureSet, .RequestPayload

Base class that defines public API for reading JSON content. Instances are created using factory methods of a JsonFactory instance.
Author
Tatu Saloranta

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
JsonParser.Feature

Enumeration that defines all on/off features for parsers.

public static enum
JsonParser.NumberType

Enumeration of possible "native" (optimal) types that can be used for numbers.

Field Summary

Modifier and TypeField and Description
protected int
_features

Bit flag composed of bits that indicate which com.fasterxml.jackson.core.JsonParser.Features are enabled.

protected transient RequestPayload
_requestPayload

Optional container that holds the request payload which will be displayed on JSON parsing error.

protected static final JacksonFeatureSet<StreamReadCapability>
DEFAULT_READ_CAPABILITIES

Default set of StreamReadCapabilityies that may be used as basis for format-specific readers (or as bogus instance if non-null set needs to be passed).

private static final int
private static final int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
protected
protected
JsonParser(int features)

Method Summary

Modifier and TypeMethod and Description
protected ObjectCodec
protected JsonParseException

Returns:

JsonParseException constructed
_constructError
(String
Base exception message to construct exception with
msg
)

Helper method for constructing JsonParseExceptions based on current state of the parser

protected JsonParseException

Returns:

Read exception (of type JsonParseException) constructed
_constructReadException
(String
Base exception message to construct exception with
msg
)

Helper method for constructing JsonParseException based on current state of the parser.

protected JsonParseException
protected JsonParseException
protected JsonParseException
protected JsonParseException

Returns:

Read exception (of type JsonParseException) constructed
_constructReadException
(String
Base exception message to construct exception with
msg
,
Throwable
Root cause to assign
t
)

Helper method for constructing JsonParseException based on current state of the parser and indicating that the given Throwable is the root cause.

protected void
_reportUnsupportedOperation()

Helper method to call for operations that are not supported by parser implementation.

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

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

public boolean

Returns:

True if this is a non-blocking ("asynchronous") parser
canParseAsync
()

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

public boolean

Returns:

True if the format being read supports native Object Ids; false if not
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

Returns:

True if the format being read supports native Type Ids; false if not
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

Returns:

True if this parser can use given schema; false if not
canUseSchema
(FormatSchema
Schema to check
schema
)

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

public abstract void
clearCurrentToken()

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

public abstract void
close()

Redeclares 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 JsonParser

Returns:

This parser, to allow call chaining
configure
(JsonParser.Feature
Feature to enable or disable
f
,
boolean
Whether to enable feature (true) or disable (false)
state
)

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

public JsonLocation

Returns:

Location of the last processed input unit (byte or character)
currentLocation
()

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

public String

Returns:

Name of the current field in the parsing context
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

Returns:

Type of the token this parser currently points to, if any: null before any tokens have been read, and after end-of-input has been encountered, as well as if the current token has been explicitly cleared.
currentToken
()

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

public int

Returns:

int matching one of constants from JsonTokenId.
currentTokenId
()

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

public JsonLocation

Returns:

Starting location of the token parser currently points to
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

Returns:

"Current value" associated with the current input context (state) of this parser
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:

This parser, to allow call chaining
disable
(JsonParser.Feature
Feature to disable
f
)

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

public JsonParser

Returns:

This parser, to allow call chaining
enable
(JsonParser.Feature
Feature to enable
f
)

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

public void
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 abstract BigInteger

Returns:

Current number value as BigInteger (if numeric token); otherwise exception thrown
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 abstract byte[]

Returns:

Decoded binary data
getBinaryValue
(Base64Variant
Expected variant of base64 encoded content (see Base64Variants for definitions of "standard" variants).
bv
)

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 byte[]

Returns:

Decoded binary data
getBinaryValue
()

Convenience alternative to getBinaryValue(Base64Variant) that defaults to using Base64Variants#getDefaultVariant as the default encoding.

public boolean

Returns:

True if current token is JsonToken.VALUE_TRUE, false if current token is JsonToken.VALUE_FALSE; otherwise throws JsonParseException
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

Returns:

Current number value as byte (if numeric token within range of [-128, 255]); otherwise exception thrown
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 abstract ObjectCodec

Returns:

Codec assigned to this parser, if any; null if none
getCodec
()

Accessor for ObjectCodec associated with this parser, if any.

public abstract JsonLocation

Returns:

Location of the last processed input unit (byte or character)
getCurrentLocation
()

Alias for currentLocation(), to be deprecated in later Jackson 2.x versions (and removed from Jackson 3.0).

public abstract String

Returns:

Name of the current field in the parsing context
getCurrentName
()

Alias of currentName().

public abstract JsonToken

Returns:

Type of the token this parser currently points to, if any: null before any tokens have been read, and
getCurrentToken
()

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

public abstract int

Returns:

int matching one of constants from JsonTokenId.
getCurrentTokenId
()

Deprecated Since 2.12 use currentTokenId instead
Deprecated alias for currentTokenId().
public Object

Returns:

Location of the last processed input unit (byte or character)
getCurrentValue
()

Alias for currentValue(), to be deprecated in later Jackson 2.x versions (and removed from Jackson 3.0).

public abstract BigDecimal

Returns:

Current number value as BigDecimal (if numeric token); otherwise exception thrown
getDecimalValue
()

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

public abstract double

Returns:

Current number value as double (if numeric token within Java double range); otherwise exception thrown
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

Returns:

Embedded value (usually of "native" type supported by format) for the current token, if any; null otherwise
getEmbeddedObject
()

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

public int

Returns:

Bit mask that defines current states of all standard Features.
getFeatureMask
()

Bulk access method for getting state of all standard Features.

public abstract float

Returns:

Current number value as float (if numeric token within Java float range); otherwise exception thrown
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 int

Returns:

Bit mask that defines current states of all standard FormatFeatures.
getFormatFeatures
()

Bulk access method for getting state of all FormatFeatures, format-specific on/off configuration settings.

public Object

Returns:

Input source this parser was configured with
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 abstract int

Returns:

Current number value as int (if numeric token within Java 32-bit signed int range); otherwise exception thrown
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 abstract JsonToken

Returns:

Last cleared token, if any; null otherwise
getLastClearedToken
()

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

public abstract long

Returns:

Current number value as long (if numeric token within Java 32-bit signed long range); otherwise exception thrown
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

Returns:

Input feeder to use with non-blocking (async) parsing
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 abstract JsonParser.NumberType

Returns:

Type of current number, if parser points to numeric token; null otherwise
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 abstract Number

Returns:

Numeric value of the current token in its most optimal representation
getNumberValue
()

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

public Object

Returns:

Either Number (for already decoded numbers) or String (for deferred decoding).
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

Returns:

Numeric value of the current token using most accurate representation
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

Returns:

Native Object id associated with the current token, if any; null if none
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 abstract JsonStreamContext

Returns:

Stream input context (JsonStreamContext) associated with this parser
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>

Returns:

Set of read capabilities for content to read via this parser
getReadCapabilities
()

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

public FormatSchema

Returns:

Schema in use by this parser, if any; null if none
getSchema
()

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

public short

Returns:

Current number value as short (if numeric token within Java 16-bit signed short range); otherwise exception thrown
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 abstract String

Returns:

Textual value associated with the current token (one returned by nextToken() or other iteration methods)
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

Returns:

The number of characters written to the Writer
getText
(Writer
Writer to write textual content to
writer
)

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

public abstract char[]

Returns:

Buffer that contains the current textual value (but not necessarily at offset 0, and not necessarily until the end of buffer)
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 abstract int

Returns:

Number of characters within buffer returned by getTextCharacters that are part of textual content of the current token.
getTextLength
()

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

public abstract int

Returns:

Offset of the first character within buffer returned by getTextCharacters that is part of textual content of the current token.
getTextOffset
()

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

public abstract JsonLocation

Returns:

Starting location of the token parser currently points to
getTokenLocation
()

Alias for currentTokenLocation(), to be deprecated in later Jackson 2.x versions (and removed from Jackson 3.0).

public Object

Returns:

Native Type Id associated with the current token, if any; null if none
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

Returns:

boolean value current token is converted to, if possible; exception thrown otherwise
getValueAsBoolean
()

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

public boolean

Returns:

boolean value current token is converted to, if possible; def otherwise
getValueAsBoolean
(boolean
Default value to return if conversion to boolean is not possible
def
)

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

public double

Returns:

double value current token is converted to, if possible; exception thrown otherwise
getValueAsDouble
()

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

public double

Returns:

double value current token is converted to, if possible; def otherwise
getValueAsDouble
(double
Default value to return if conversion to double is not possible
def
)

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

public int

Returns:

int value current token is converted to, if possible; exception thrown otherwise
getValueAsInt
()

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

public int

Returns:

int value current token is converted to, if possible; def otherwise
getValueAsInt
(int
Default value to return if conversion to int is not possible
def
)

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

public long

Returns:

long value current token is converted to, if possible; exception thrown otherwise
getValueAsLong
()

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

public long

Returns:

long value current token is converted to, if possible; def otherwise
getValueAsLong
(long
Default value to return if conversion to long is not possible
def
)

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

public String

Returns:

String value current token is converted to, if possible; null otherwise
getValueAsString
()

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

public abstract String

Returns:

String value current token is converted to, if possible; def otherwise
getValueAsString
(String
Default value to return if conversion to String is not possible
def
)

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

public abstract boolean

Returns:

True if the parser just returned a valid token via nextToken; false otherwise (parser was just constructed, encountered end-of-input and returned null from nextToken, or the token has been consumed)
hasCurrentToken
()

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

public abstract boolean

Returns:

True if parser currently has character array that can be efficiently returned via getTextCharacters; false means that it may or may not exist
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 abstract boolean

Returns:

True if the parser current points to specified token
hasToken
(JsonToken
Token to match
t
)

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

public abstract boolean

Returns:

True if the parser current points to specified token
hasTokenId
(int
Token id to match (from (@link JsonTokenId})
id
)

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

public abstract boolean

Returns:

True if this parser instance has been closed
isClosed
()

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

public boolean

Returns:

True if feature is enabled; false otherwise
isEnabled
(JsonParser.Feature
Feature to check
f
)

Method for checking whether specified Feature is enabled.

public boolean

Returns:

True if feature is enabled; false otherwise
isEnabled
(StreamReadFeature
Feature to check
f
)

Method for checking whether specified Feature is enabled.

public boolean

Returns:

True if the current token can be considered as a start-array marker (such JsonToken#VALUE_NUMBER_INT); false if not
isExpectedNumberIntToken
()

Similar to isExpectedStartArrayToken(), but checks whether stream currently points to JsonToken#VALUE_NUMBER_INT.

public boolean

Returns:

True if the current token can be considered as a start-array marker (such JsonToken#START_ARRAY); false if not
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

Returns:

True if the current token can be considered as a start-array marker (such JsonToken#START_OBJECT); false if not
isExpectedStartObjectToken
()

Similar to isExpectedStartArrayToken(), but checks whether stream currently points to JsonToken#START_OBJECT.

public boolean

Returns:

True if the current token is of type JsonToken#VALUE_NUMBER_FLOAT but represents a "Not a Number"; false for other tokens and regular floating-point numbers
isNaN
()

Access for checking whether current token is a numeric value token, but one that is of "not-a-number" (NaN) variety (including both "NaN" AND positive/negative infinity!): not supported by all formats, but often supported for JsonToken#VALUE_NUMBER_FLOAT.

public Boolean

Returns:

Boolean value of the JsonToken.VALUE_TRUE or JsonToken.VALUE_FALSE token parser advanced to; or null if next token is of some other type
nextBooleanValue
()

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_TRUE or JsonToken#VALUE_FALSE returns matching Boolean value; otherwise return null.

public boolean

Returns:

True if parser advanced to JsonToken.FIELD_NAME with specified name; false otherwise (different token or non-matching name)
nextFieldName
(SerializableString
Property name to compare next token to (if next token is JsonToken.FIELD_NAME)
str
)

Method that fetches next token (as if calling nextToken) and verifies whether it is JsonToken#FIELD_NAME with specified name and returns result of that comparison.

public String

Returns:

Name of the the JsonToken.FIELD_NAME parser advanced to, if any; null if next token is of some other type
nextFieldName
()

Method that fetches next token (as if calling nextToken) and verifies whether it is JsonToken#FIELD_NAME; if it is, returns same as getCurrentName(), otherwise null.

public int

Returns:

Integer (int) value of the JsonToken.VALUE_NUMBER_INT token parser advanced to; or defaultValue if next token is of some other type
nextIntValue
(int
Value to return if next token is NOT of type JsonToken.VALUE_NUMBER_INT
defaultValue
)

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_NUMBER_INT returns 32-bit int value; otherwise returns specified default value It is functionally equivalent to:

  return (nextToken() == JsonToken.VALUE_NUMBER_INT) ?
public long

Returns:

long value of the JsonToken.VALUE_NUMBER_INT token parser advanced to; or defaultValue if next token is of some other type
nextLongValue
(long
Value to return if next token is NOT of type JsonToken.VALUE_NUMBER_INT
defaultValue
)

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_NUMBER_INT returns 64-bit long value; otherwise returns specified default value It is functionally equivalent to:

  return (nextToken() == JsonToken.VALUE_NUMBER_INT) ?
public String

Returns:

Text value of the JsonToken.VALUE_STRING token parser advanced to; or null if next token is of some other type
nextTextValue
()

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_STRING returns contained String value; otherwise returns null.

public abstract JsonToken

Returns:

Next token from the stream, if any found, or null to indicate end-of-input
nextToken
()

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

public abstract JsonToken

Returns:

Next non-field-name token from the stream, if any found, or null to indicate end-of-input (or, for non-blocking parsers, JsonToken#NOT_AVAILABLE if no tokens were available yet)
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 abstract void
overrideCurrentName(String
Name to use as the current name; may be null.
name
)

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

public JsonParser

Returns:

This parser, to allow call chaining
overrideFormatFeatures
(int
Bit mask of set/clear state for features to change
values
,
int
Bit mask of features to change
mask
)

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

Returns:

This parser, to allow call chaining
overrideStdFeatures
(int
Bit mask of set/clear state for features to change
values
,
int
Bit mask of features to change
mask
)

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

public int

Returns:

Number of bytes that were decoded and written via OutputStream
readBinaryValue
(OutputStream
Output stream to use for passing decoded binary data
out
)

Method that can be used as an alternative to getBigIntegerValue(), especially when value can be large.

public int

Returns:

Number of bytes that were decoded and written via OutputStream
readBinaryValue
(Base64Variant
base64 variant to use
bv
,
OutputStream
Output stream to use for passing decoded binary data
out
)

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

public <
Nominal type parameter for value type
T
>
T

Returns:

Java value read from content
readValueAs
(Class<T>
Java type to read content as (passed to ObjectCodec that deserializes content)
valueType
)

Method to deserialize JSON content into a non-container type (it can be an array type, however): typically a bean, array or a wrapper type (like java.lang.Boolean)

Note

method can only be called if the parser has an object codec assigned; this is true for parsers constructed by MappingJsonFactory (from "jackson-databind" jar) but not for JsonFactory (unless its setCodec method has been explicitly called).

public <
Nominal type parameter for value type
T
>
T

Returns:

Java value read from content
readValueAs
(TypeReference<?>
Java type to read content as (passed to ObjectCodec that deserializes content)
valueTypeRef
)

Method to deserialize JSON content into a Java type, reference to which is passed as argument.

public <
Nominal type parameter for result node type (to reduce need for casting)
T extends TreeNode
>
T

Returns:

root of the document, or null if empty or whitespace.
readValueAsTree
()

Method to deserialize JSON content into equivalent "tree model", represented by root TreeNode of resulting model.

public <
Nominal type parameter for value type
T
>
Iterator<T>

Returns:

Iterator for reading multiple Java values from content
readValuesAs
(Class<T>
Java type to read content as (passed to ObjectCodec that deserializes content)
valueType
)

Method for reading sequence of Objects from parser stream, all with same specified value type.

public <
Nominal type parameter for value type
T
>
Iterator<T>

Returns:

Iterator for reading multiple Java values from content
readValuesAs
(TypeReference<T>
Java type to read content as (passed to ObjectCodec that deserializes content)
valueTypeRef
)

Method for reading sequence of Objects from parser stream, all with same specified value type.

public int

Returns:

-1 if the underlying content source is not byte based (that is, input can not be sent to OutputStream; otherwise number of bytes released (0 if there was nothing to release)
releaseBuffered
(OutputStream
OutputStream to which buffered, undecoded content is written to
out
)

Method that can be called to push back any content that has been read but not consumed by the parser.

public int

Returns:

-1 if the underlying content source is not char-based (that is, input can not be sent to Writer; otherwise number of chars released (0 if there was nothing to release)
releaseBuffered
(Writer
Writer to which buffered but unprocessed content is written to
w
)

Method that can be called to push back any content that has been read but not consumed by the parser.

public boolean

Returns:

True if format-specific codec is needed with this parser; false if a general ObjectCodec is enough
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 abstract void
setCodec(ObjectCodec
Codec to assign, if any; null if none
oc
)

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
)

Alias for assignCurrentValue, to be deprecated in later Jackson 2.x versions (and removed from Jackson 3.0).

public JsonParser

Returns:

This parser, to allow call chaining
setFeatureMask
(int
Bit mask that defines set of features to enable
mask
)

Deprecated Since 2.7, use overrideStdFeatures(int, int) instead
Bulk set method for (re)setting states of all standard Features
public void
setRequestPayloadOnError(RequestPayload
Payload to pass
payload
)

Sets the payload to be passed if JsonParseException is thrown.

public void
setRequestPayloadOnError(byte[]
Payload to pass
payload
,
String
Character encoding for (lazily) decoding payload
charset
)

Sets the byte[] request payload and the charset

public void
setRequestPayloadOnError(String
Payload to pass
payload
)

Sets the String request payload

public void
setSchema(FormatSchema
Schema to use
schema
)

Method to call to make this parser use specified schema.

public abstract JsonParser

Returns:

This parser, to allow call chaining
skipChildren
()

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

public StreamReadConstraints

Returns:

Read constraints used by this parser
streamReadConstraints
()

Get the constraints to apply when performing streaming reads.

public abstract Version

Returns:

Version of this generator (derived from version declared for jackson-core jar that contains the class
version
()

Redeclares com.fasterxml.jackson.core.Versioned.version.

Accessor for getting version of the core package, given a parser instance.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait