java.lang.Object | |||
↳ | com.fasterxml.jackson.core.JsonParser | ||
↳ | com.fasterxml.jackson.core.base.ParserMinimalBase | ||
↳ | com.fasterxml.jackson.core.base.ParserBase |
Known Direct Subclasses |
Intermediate base class used by all Jackson JsonParser
implementations. Contains most common things that are independent
of actual underlying input source
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
char | CHAR_NULL | ||||||||||
int | INT_0 | ||||||||||
int | INT_1 | ||||||||||
int | INT_2 | ||||||||||
int | INT_3 | ||||||||||
int | INT_4 | ||||||||||
int | INT_5 | ||||||||||
int | INT_6 | ||||||||||
int | INT_7 | ||||||||||
int | INT_8 | ||||||||||
int | INT_9 | ||||||||||
int | INT_DECIMAL_POINT | ||||||||||
int | INT_E | ||||||||||
int | INT_MINUS | ||||||||||
int | INT_PLUS | ||||||||||
int | INT_e | ||||||||||
int | NR_BIGDECIMAL | ||||||||||
int | NR_BIGINT | ||||||||||
int | NR_DOUBLE | ||||||||||
int | NR_INT | ||||||||||
int | NR_LONG | ||||||||||
int | NR_UNKNOWN |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.fasterxml.jackson.core.base.ParserMinimalBase
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
_binaryValue | We will hold on to decoded binary data, for duration of
current event, so that multiple calls to
getBinaryValue() will not need to decode data more
than once. |
||||||||||
_byteArrayBuilder | ByteArrayBuilder is needed if 'getBinaryValue' is called. | ||||||||||
_closed | Flag that indicates whether parser is closed or not. | ||||||||||
_currInputProcessed | Number of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer). | ||||||||||
_currInputRow | Current row location of current point in input buffer, starting from 1, if available. | ||||||||||
_currInputRowStart | Current index of the first character of the current row in input buffer. | ||||||||||
_expLength | Length of the exponent part of the number, if any, not including 'e' marker or sign, just digits. | ||||||||||
_fractLength | Length of the fractional part (not including decimal point or exponent), in characters. | ||||||||||
_inputEnd | Index of character after last available one in the buffer. | ||||||||||
_inputPtr | Pointer to next available character in buffer | ||||||||||
_intLength | Length of integer part of the number, in characters | ||||||||||
_ioContext | I/O context for this reader. | ||||||||||
_nameCopied | Flag set to indicate whether the field name is available from the name copy buffer or not (in addition to its String representation being available via read context) | ||||||||||
_nameCopyBuffer | Temporary buffer that is needed if field name is accessed
using getTextCharacters() method (instead of String
returning alternatives)
|
||||||||||
_nextToken | Secondary token related to the next token after current one; used if its type is known. | ||||||||||
_numTypesValid | Bitfield that indicates which numeric representations have been calculated for the current type | ||||||||||
_numberBigDecimal | |||||||||||
_numberBigInt | |||||||||||
_numberDouble | |||||||||||
_numberInt | |||||||||||
_numberLong | |||||||||||
_numberNegative | Flag that indicates whether numeric value has a negative value. | ||||||||||
_parsingContext | Information about parser context, context in which the next token is to be parsed (root, array, object). | ||||||||||
_textBuffer | Buffer that contains contents of String values, including field names if necessary (name split across boundary, contains escape sequence, or access needed to char array) | ||||||||||
_tokenInputCol | Column on input row that current token starts; 0-based (although in the end it'll be converted to 1-based) | ||||||||||
_tokenInputRow | Input row on which current token starts, 1-based | ||||||||||
_tokenInputTotal | Total number of bytes/characters read before start of current token. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.fasterxml.jackson.core.base.ParserMinimalBase
| |||||||||||
From class
com.fasterxml.jackson.core.JsonParser
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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
AUTO_CLOSE_SOURCE is enabled. | |||||||||||
Numeric accessor that can be called when the current
token is of type
VALUE_NUMBER_INT and
it can not be used as a Java long primitive type due to its
magnitude. | |||||||||||
Method that returns location of the last processed character;
usually for error reporting purposes
| |||||||||||
Method that can be called to get the name associated with
the current event.
| |||||||||||
Numeric accessor that can be called when the current
token is of type
VALUE_NUMBER_FLOAT or
VALUE_NUMBER_INT . | |||||||||||
Numeric accessor that can be called when the current
token is of type
VALUE_NUMBER_FLOAT and
it can be expressed as a Java double primitive type. | |||||||||||
Numeric accessor that can be called when the current
token is of type
VALUE_NUMBER_FLOAT and
it can be expressed as a Java float primitive type. | |||||||||||
Numeric accessor that can be called when the current
token is of type
VALUE_NUMBER_INT and
it can be expressed as a value of Java int primitive type. | |||||||||||
Numeric accessor that can be called when the current
token is of type
VALUE_NUMBER_INT and
it can be expressed as a Java long primitive type. | |||||||||||
If current token is of type
VALUE_NUMBER_INT or
VALUE_NUMBER_FLOAT , returns
one of JsonParser.NumberType constants; otherwise returns null. | |||||||||||
Generic number value accessor method that will work for
all kinds of numeric values.
| |||||||||||
Method that can be used to access current parsing context reader
is in.
| |||||||||||
Method that return the starting location of the current
token; that is, position of the first character from input
that starts the current token.
| |||||||||||
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. | |||||||||||
Method that can be called to determine whether this parser
is closed or not.
| |||||||||||
Method that can be used to change what is considered to be
the current (field) name.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Method that sub-classes must implement to support escaped sequences
in base64-encoded sections.
| |||||||||||
Method called when an EOF is encountered between tokens.
| |||||||||||
Method that will parse actual numeric value out of a syntactically
valid number value.
| |||||||||||
Method called to release internal buffers owned by the base
reader.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.fasterxml.jackson.core.base.ParserMinimalBase
| |||||||||||
From class
com.fasterxml.jackson.core.JsonParser
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.fasterxml.jackson.core.Versioned
| |||||||||||
From interface
java.io.Closeable
| |||||||||||
From interface
java.lang.AutoCloseable
|
We will hold on to decoded binary data, for duration of
current event, so that multiple calls to
getBinaryValue()
will not need to decode data more
than once.
ByteArrayBuilder is needed if 'getBinaryValue' is called. If so, we better reuse it for remainder of content.
Flag that indicates whether parser is closed or not. Gets
set when parser is either closed by explicit call
(close()
) or when end-of-input is reached.
Number of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer).
Current row location of current point in input buffer, starting from 1, if available.
Current index of the first character of the current row in input buffer. Needed to calculate column position, if necessary; benefit of not having column itself is that this only has to be updated once per line.
Length of the exponent part of the number, if any, not including 'e' marker or sign, just digits. Not used for pure integer values.
Length of the fractional part (not including decimal point or exponent), in characters. Not used for pure integer values.
Index of character after last available one in the buffer.
Pointer to next available character in buffer
Length of integer part of the number, in characters
I/O context for this reader. It handles buffer allocation for the reader.
Flag set to indicate whether the field name is available from the name copy buffer or not (in addition to its String representation being available via read context)
Temporary buffer that is needed if field name is accessed
using getTextCharacters()
method (instead of String
returning alternatives)
Secondary token related to the next token after current one; used if its type is known. This may be value token that follows FIELD_NAME, for example.
Bitfield that indicates which numeric representations have been calculated for the current type
Flag that indicates whether numeric value has a negative value. That is, whether its textual representation starts with minus character.
Information about parser context, context in which the next token is to be parsed (root, array, object).
Buffer that contains contents of String values, including field names if necessary (name split across boundary, contains escape sequence, or access needed to char array)
Column on input row that current token starts; 0-based (although in the end it'll be converted to 1-based)
Input row on which current token starts, 1-based
Total number of bytes/characters read before start of current token. For big (gigabyte-sized) sizes are possible, needs to be long, unlike pointers and sizes related to in-memory buffers.
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
AUTO_CLOSE_SOURCE
is enabled.
Whether parser owns the input source depends on factory
method that was used to construct instance (so check
JsonFactory
for details,
but the general
idea is that if caller passes in closable resource (such
as InputStream or Reader) parser does NOT
own the source; but if it passes a reference (such as
java.io.File or java.net.URL and creates
stream or reader it does own them.
IOException |
---|
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_INT
and
it can not be used as a Java long primitive type due to its
magnitude.
It can also be called for VALUE_NUMBER_FLOAT
;
if so, it is equivalent to calling getDecimalValue()
and then constructing a BigInteger
from that value.
IOException | |
---|---|
JsonParseException |
Method that returns location of the last processed character; usually for error reporting purposes
Method that can be called to get the name associated with the current event.
IOException | |
---|---|
JsonParseException |
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_FLOAT
or
VALUE_NUMBER_INT
. No under/overflow exceptions
are ever thrown.
IOException | |
---|---|
JsonParseException |
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_FLOAT
and
it can be expressed as a Java double primitive type.
It can also be called for VALUE_NUMBER_INT
;
if so, it is equivalent to calling getLongValue()
and then casting; except for possible overflow/underflow
exception.
Note: if the value falls
outside of range of Java double, a JsonParseException
will be thrown to indicate numeric overflow/underflow.
IOException | |
---|---|
JsonParseException |
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_FLOAT
and
it can be expressed as a Java float primitive type.
It can also be called for VALUE_NUMBER_INT
;
if so, it is equivalent to calling getLongValue()
and then casting; except for possible overflow/underflow
exception.
Note: if the value falls
outside of range of Java float, a JsonParseException
will be thrown to indicate numeric overflow/underflow.
IOException | |
---|---|
JsonParseException |
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_INT
and
it can be expressed as a value of Java int primitive type.
It can also be called for VALUE_NUMBER_FLOAT
;
if so, it is equivalent to calling getDoubleValue()
and then casting; except for possible overflow/underflow
exception.
Note: if the resulting integer value falls outside range of
Java int, a JsonParseException
may be thrown to indicate numeric overflow/underflow.
IOException | |
---|---|
JsonParseException |
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_INT
and
it can be expressed as a Java long primitive type.
It can also be called for VALUE_NUMBER_FLOAT
;
if so, it is equivalent to calling getDoubleValue()
and then casting to int; except for possible overflow/underflow
exception.
Note: if the token is an integer, but its value falls
outside of range of Java long, a JsonParseException
may be thrown to indicate numeric overflow/underflow.
IOException | |
---|---|
JsonParseException |
If current token is of type
VALUE_NUMBER_INT
or
VALUE_NUMBER_FLOAT
, returns
one of JsonParser.NumberType
constants; otherwise returns null.
IOException | |
---|---|
JsonParseException |
Generic number value accessor method that will work for all kinds of numeric values. It will return the optimal (simplest/smallest possible) wrapper object that can express the numeric value just parsed.
IOException | |
---|---|
JsonParseException |
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. Contexts are hierarchically nested, and can be used for example for figuring out part of the input document that correspond to specific array or object (for highlighting purposes, or error reporting). Contexts can also be used for simple xpath-like matching of input, if so desired.
Method that return the starting location of the current token; that is, position of the first character from input that starts the current token.
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.
Default implementation simply returns false since only actual implementation class has knowledge of its internal buffering state. Implementations are strongly encouraged to properly override this method, to allow efficient copying of content by other code.
getTextCharacters()
; false
means that it may or may not exist
Method that can be called to determine whether this parser
is closed or not. If it is closed, no new tokens can be
retrieved by calling nextToken()
(and the underlying
stream may be closed). Closing may be due to an explicit
call to close()
or because parser has encountered
end of input.
Method that can be used to change what is considered to be the current (field) name. May be needed to support non-JSON data formats or unusual binding conventions; not needed for typical processing.
Note that use of this method should only be done as sort of last resort, as it is a work-around for regular operation.
name | Name to use as the current name; may be null. |
---|
IOException | |
---|---|
JsonParseException |
IOException | |
---|---|
JsonParseException |
Method that sub-classes must implement to support escaped sequences in base64-encoded sections. Sub-classes that do not need base64 support can leave this as is
IOException | |
---|---|
JsonParseException |
Method called when an EOF is encountered between tokens. If so, it may be a legitimate EOF, but only iff there is no open non-root context.
JsonParseException |
---|
Method that will parse actual numeric value out of a syntactically valid number value. Type it will parse into depends on whether it is a floating point number, as well as its magnitude: smallest legal type (of ones available) is used for efficiency.
expType | Numeric type that we will immediately need, if any; mostly necessary to optimize handling of floating point numbers |
---|
IOException | |
---|---|
JsonParseException |
Method called to release internal buffers owned by the base
reader. This may be called along with _closeInput()
(for
example, when explicitly closing this reader instance), or
separately (if need be).
IOException |
---|
bindex | Relative index within base64 character unit; between 0 and 3 (as unit has exactly 4 characters) |
---|
IllegalArgumentException |
---|
IllegalArgumentException |
---|