JsonFactory instance.
| Modifier and Type | Class 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. |
| Modifier and Type | Field and Description |
|---|---|
| protected int | _features
Bit flag composed of bits that indicate which
|
| protected transient RequestPayload | _requestPayload
Optional container that holds the request payload which will be displayed on JSON parsing error. |
| protected static final JacksonFeatureSet | DEFAULT_READ_CAPABILITIES
Default set of |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected ObjectCodec | |
| protected JsonParseException | Returns: JsonParseException constructedBase exception message to construct exception with msg)Helper method for constructing |
| protected JsonParseException | Returns: Read exception (of typeJsonParseException) constructedBase exception message to construct exception with msg)Helper method for constructing |
| protected JsonParseException | |
| protected JsonParseException | |
| protected JsonParseException | |
| protected JsonParseException | Returns: Read exception (of typeJsonParseException) constructedBase exception message to construct exception with msg, Throwable Root cause to assign t)Helper method for constructing |
| 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:
|
| public boolean | Returns: True if this is a non-blocking ("asynchronous") parserMethod 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 notIntrospection 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 notIntrospection 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 notSchema to check schema)Method that can be used to verify that given schema can be used with
this parser (using |
| public abstract void | clearCurrentToken()
Method called to "consume" the current token by effectively
removing it so that |
| public abstract void | close()
Redeclares java. Feature#AUTO_CLOSE_SOURCE is enabled.
|
| public JsonParser | Returns: This parser, to allow call chainingFeature to enable or disable f,Whether to enable feature ( state)true) or disable (false)Method for enabling or disabling specified feature
(check |
| public JsonLocation | Returns: Location of the last processed input unit (byte or character)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 contextMethod that can be called to get the name associated with
the current token: for |
| 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.Accessor to find which token parser currently points to, if any; null will be returned if none. |
| public int | currentTokenId()
Method similar to |
| public JsonLocation | Returns: Starting location of the token parser currently points toMethod 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 parserHelper method, usually equivalent to:
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 chainingFeature to disable fMethod for disabling specified feature
(check |
| public JsonParser | Returns: This parser, to allow call chainingFeature to enable fMethod for enabling specified parser feature
(check |
| 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 asBigInteger (if numeric token);
otherwise exception thrownNumeric accessor that can be called when the current
token is of type |
| public abstract byte[] | Returns: Decoded binary dataExpected variant of base64 encoded
content (see bv)Base64Variants for definitions
of "standard" variants).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 dataConvenience alternative to |
| public boolean | Returns: True if current token is JsonToken.VALUE_TRUE,
false if current token is JsonToken.VALUE_FALSE;
otherwise throws JsonParseExceptionConvenience accessor that can be called when the current
token is |
| public byte | Returns: Current number value asbyte (if numeric token within
range of [-128, 255]); otherwise exception thrownNumeric accessor that can be called when the current
token is of type |
| public abstract ObjectCodec | Returns: Codec assigned to this parser, if any;null if noneAccessor for |
| public abstract JsonLocation | Returns: Location of the last processed input unit (byte or character)Alias for |
| public abstract String | |
| public abstract JsonToken | Returns: Type of the token this parser currently points to, if any: null before any tokens have been read, andAlias for |
| public abstract int | getCurrentTokenId()
Deprecated
Since 2.12 use
Deprecated alias for currentTokenId instead
currentTokenId().
|
| public Object | Returns: Location of the last processed input unit (byte or character)Alias for |
| public abstract BigDecimal | Returns: Current number value asBigDecimal (if numeric token);
otherwise exception thrownNumeric accessor that can be called when the current
token is of type |
| public abstract double | Returns: Current number value asdouble (if numeric token within
Java double range); otherwise exception thrownNumeric accessor that can be called when the current
token is of type |
| public Object | Returns: Embedded value (usually of "native" type supported by format) for the current token, if any;null otherwiseAccessor that can be called if (and only if) the current token
is |
| public int | Returns: Bit mask that defines current states of all standardFeatures.Bulk access method for getting state of all standard |
| public abstract float | Returns: Current number value asfloat (if numeric token within
Java float range); otherwise exception thrownNumeric accessor that can be called when the current
token is of type |
| public int | Returns: Bit mask that defines current states of all standardFormatFeatures.Bulk access method for getting state of all |
| public Object | Returns: Input source this parser was configured withMethod that can be used to get access to object that is used
to access input being parsed; this is usually either
|
| public abstract int | Returns: Current number value asint (if numeric token within
Java 32-bit signed int range); otherwise exception thrownNumeric accessor that can be called when the current
token is of type |
| public abstract JsonToken | Returns: Last cleared token, if any;null otherwiseMethod that can be called to get the last token that was
cleared using |
| public abstract long | Returns: Current number value aslong (if numeric token within
Java 32-bit signed long range); otherwise exception thrownNumeric accessor that can be called when the current
token is of type |
| public NonBlockingInputFeeder | Returns: Input feeder to use with non-blocking (async) parsingMethod that will either return a feeder instance (if parser uses
non-blocking, aka asynchronous access); or |
| public abstract JsonParser. | Returns: Type of current number, if parser points to numeric token;null otherwiseIf current token is of type
|
| public abstract Number | Returns: Numeric value of the current token in its most optimal representationGeneric number value accessor method that will work for all kinds of numeric values. |
| public Object | getNumberValueDeferred()
Method similar to |
| public Number | Returns: Numeric value of the current token using most accurate representationMethod similar to |
| public Object | Returns: Native Object id associated with the current token, if any;null if noneMethod 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 parserMethod 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 | Returns: Set of read capabilities for content to read via this parserAccessor 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 noneMethod for accessing Schema that this parser uses, if any. |
| public short | Returns: Current number value asshort (if numeric token within
Java 16-bit signed short range); otherwise exception thrownNumeric accessor that can be called when the current
token is of type |
| public abstract String | Returns: Textual value associated with the current token (one returned bynextToken() or other iteration methods)Method for accessing textual representation of the current token;
if no current token (before first call to |
| public int | |
| 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)Method similar to |
| public abstract int | Returns: Number of characters within buffer returned bygetTextCharacters that are part of
textual content of the current token.Accessor used with |
| public abstract int | Returns: Offset of the first character within buffer returned bygetTextCharacters that is part of
textual content of the current token.Accessor used with |
| public abstract JsonLocation | Returns: Starting location of the token parser currently points toAlias for |
| public Object | Returns: Native Type Id associated with the current token, if any;null if noneMethod 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
otherwiseMethod 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 otherwiseDefault value to return if conversion to def)boolean is not possibleMethod 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
otherwiseMethod 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 otherwiseDefault value to return if conversion to def)double is not possibleMethod 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
otherwiseMethod that will try to convert value of current token to a
Java |
| public int | Returns: int value current token is converted to, if possible; def otherwiseDefault value to return if conversion to def)int is not possibleMethod 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
otherwiseMethod 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 otherwiseDefault value to return if conversion to def)long is not possibleMethod that will try to convert value of current token to a long. |
| public String | |
| public abstract String | getValueAsString(String
Default value to return if conversion to def)String is not possibleMethod that will try to convert value of current token to a
|
| public abstract boolean | 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 viagetTextCharacters; false
means that it may or may not existMethod that can be used to determine whether calling of
|
| public abstract boolean | |
| public abstract boolean | Returns: True if the parser current points to specified tokenToken id to match (from (@link JsonTokenId}) id)Method that is functionally equivalent to:
|
| public abstract boolean | Returns: True if this parser instance has been closedMethod that can be called to determine whether this parser is closed or not. |
| public boolean | Returns: True if feature is enabled; false otherwiseFeature to check fMethod for checking whether specified |
| public boolean | Returns: True if feature is enabled; false otherwiseFeature to check f)Method for checking whether specified |
| public boolean | Returns: True if the current token can be considered as a start-array marker (suchJsonToken#VALUE_NUMBER_INT);
false if notSimilar to |
| public boolean | Returns: True if the current token can be considered as a start-array marker (suchJsonToken#START_ARRAY);
false if notSpecialized accessor that can be used to verify that the current
token indicates start array (usually meaning that current token
is |
| public boolean | Returns: True if the current token can be considered as a start-array marker (suchJsonToken#START_OBJECT);
false if notSimilar to |
| 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 numbersAccess 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 |
| 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 typeMethod that fetches next token (as if calling |
| public boolean | Returns: True if parser advanced to JsonToken.FIELD_NAME with
specified name; false otherwise (different token or non-matching name)Property name to compare next token to (if next token is
str)JsonToken.FIELD_NAME)Method that fetches next token (as if calling |
| public String | Returns: Name of the theJsonToken.FIELD_NAME parser advanced to, if any;
null if next token is of some other typeMethod that fetches next token (as if calling |
| 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 typeValue to return if next token is NOT of type defaultValue)JsonToken.VALUE_NUMBER_INTMethod that fetches next token (as if calling 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 typeValue to return if next token is NOT of type defaultValue)JsonToken.VALUE_NUMBER_INTMethod that fetches next token (as if calling return (nextToken() == JsonToken.VALUE_NUMBER_INT) ? |
| public String | Returns: Text value of theJsonToken.VALUE_STRING token parser advanced
to; or null if next token is of some other typeMethod that fetches next token (as if calling |
| public abstract JsonToken | Returns: Next token from the stream, if any found, or null to indicate end-of-inputMain 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)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 chainingBit 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 |
| public JsonParser | Returns: This parser, to allow call chainingBit 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 |
| public int | Returns: Number of bytes that were decoded and written viaOutputStreamOutput stream to use for passing decoded binary data out)Method that can be used as an alternative to |
| public int | Returns: Number of bytes that were decoded and written viaOutputStreambase64 variant to use bv, OutputStream Output stream to use for passing decoded binary data out)Similar to |
| public < Nominal type parameter for value type T> T | Returns: Java value read from contentJava 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 Note method can only be called if the parser has
an object codec assigned; this is true for parsers constructed
by |
| public < Nominal type parameter for value type T> T | Returns: Java value read from contentJava 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.Method to deserialize JSON content into equivalent "tree model",
represented by root |
| public < Nominal type parameter for value type T> Iterator | Returns: Iterator for reading multiple Java values from contentJava 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 | Returns: Iterator for reading multiple Java values from contentJava 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 toOutputStream;
otherwise number of bytes released (0 if there was nothing to release)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 toWriter;
otherwise number of chars released (0 if there was nothing to release)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 generalObjectCodec is enoughMethod that can be called to determine if a custom
|
| public abstract void | setCodec(ObjectCodec
Codec to assign, if any; oc)null if noneSetter that allows defining |
| public void | setCurrentValue(Object
Current value to assign for the current input context of this parser v)Alias for |
| public JsonParser | Returns: This parser, to allow call chainingBit mask that defines set of features to enable mask)
Deprecated
Since 2.7, use
Bulk set method for (re)setting states of all standard overrideStdFeatures(int, int) instead
Features
|
| public void | setRequestPayloadOnError(RequestPayload
Payload to pass payload)Sets the payload to be passed if |
| 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 | |
| public void | |
| public abstract JsonParser | Returns: This parser, to allow call chainingMethod that will skip all child tokens of an array or
object token that the parser currently points to,
iff stream points to
|
| public StreamReadConstraints | Returns: Read constraints used by this parserGet the constraints to apply when performing streaming reads. |
| public abstract Version | Returns: Version of this generator (derived from version declared forjackson-core jar that contains the classRedeclares com. |