JsonParser
implementations. Contains most common things that are independent
of actual underlying input source.
| Modifier and Type | Field and Description |
|---|---|
| protected byte[] | _binaryValue
We will hold on to decoded binary data, for duration of
current event, so that multiple calls to
|
| protected ByteArrayBuilder | _byteArrayBuilder
ByteArrayBuilder is needed if 'getBinaryValue' is called. |
| protected long | _currInputProcessed
Number of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer). |
| protected int | _currInputRow
Current row location of current point in input buffer, starting from 1, if available. |
| protected int | _currInputRowStart
Current index of the first character of the current row in input buffer. |
| protected int | _expLength
Length of the exponent part of the number, if any, not including 'e' marker or sign, just digits. |
| protected int | _fractLength
Length of the fractional part (not including decimal point or exponent), in characters. |
| protected int | _inputEnd
Index of character after last available one in the buffer. |
| protected int | _inputPtr
Pointer to next available character in buffer |
| protected int | _intLength
Length of integer part of the number, in characters |
| protected BigDecimal | |
| protected BigInteger | |
| protected double | |
| protected float | |
| protected int | |
| protected boolean | _numberIsNaN
Marker for explicit "Not a Number" (NaN) values that may be read by some formats: this includes positive and negative infinity, as well as "NaN" result for some arithmetic operations. |
| protected long | |
| protected boolean | _numberNegative
Flag that indicates whether numeric value has a negative value. |
| protected String | _numberString
Textual number representation captured from input in cases lazy-parsing is desired. |
| protected int | _numTypesValid
Bitfield that indicates which numeric representations have been calculated for the current type |
| protected final TextBuffer | _textBuffer
Buffer that contains contents of String values, including property names if necessary (name split across boundary, contains escape sequence, or access needed to char array) |
| protected int | _tokenInputCol
Column on input row that current token starts; 0-based (although in the end it'll be converted to 1-based) |
| protected int | _tokenInputRow
Input row on which current token starts, 1-based |
| protected long | _tokenInputTotal
Total number of bytes/characters read before start of current token. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected ContentReference | Returns: ContentReference object to use.Helper method used to encapsulate logic of including (or not) of
"content reference" when constructing |
| protected ContentReference | Returns: ContentReference object to use when source is not to be includedHelper method used to encapsulate logic of providing
"content reference" when constructing |
| protected BigInteger | |
| protected final int | |
| protected final int | |
| protected char | Returns: Character decoded, if anyMethod that sub-classes must implement to support escaped sequences in base64-encoded sections. |
| protected final int | |
| protected BigDecimal | Returns: BigDecimal value decoded or converted for the current eventInternal accessor that needs to be used for accessing number value of type
|
| protected BigInteger | Returns: BigInteger value decoded or converted for the current eventInternal accessor that needs to be used for accessing number value of type
|
| protected ByteArrayBuilder | |
| protected double | Returns: double value decoded or converted for the current eventInternal accessor that needs to be used for accessing number value of type
|
| protected float | Returns: float value decoded or converted for the current eventInternal accessor that needs to be used for accessing number value of type
|
| protected int[] | |
| protected <T> T | |
| protected void | _handleEOF()
Implements abstract tools. Method called when an EOF is encountered between tokens. |
| protected abstract int | |
| protected abstract void | _parseNumericValue(int
Numeric type that we will immediately need, if any;
mostly necessary to optimize handling of floating point numbers expType)Method that will parse actual numeric value out of a syntactically valid number value. |
| protected void | _releaseBuffers()
Implements abstract tools. Method called to release internal buffers owned by the base reader. |
| protected <T> T | |
| protected <T> T | |
| public void | assignCurrentValue(Object v)
Implements abstract tools. Helper method, usually equivalent to:
|
| public void | close()
Overrides tools. Implements java. Method that can be called to get the name associated with the current event. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public Object | currentValue()
Implements abstract tools. Helper 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 BigInteger | getBigIntegerValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public byte[] | getBinaryValue(Base64Variant variant)
Implements abstract tools. 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 BigDecimal | getDecimalValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public double | getDoubleValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public float | getFloatValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public int | getIntValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public long | getLongValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public JsonParser. | getNumberType()
Implements abstract tools. If current token is of type
|
| public Number | getNumberValue()
Implements abstract tools. Generic number value accessor method that will work for all kinds of numeric values. |
| public Object | getNumberValueDeferred()
Overrides tools. Method similar to |
| public Number | getNumberValueExact()
Overrides tools. Method similar to |
| public long | |
| public int | |
| public int | |
| protected static int[] | |
| public boolean | hasStringCharacters()
Implements abstract tools. Method that can be used to determine whether calling of
|
| public boolean | isNaN()
Implements abstract tools. Accessor for checking whether current token is a special "not-a-number" (NaN) token (including both "NaN" AND positive/negative infinity!). |
| protected final JsonToken | |
| protected final JsonToken | |
| protected final JsonToken | |
| protected final JsonToken |
| _binaryValue | back to summary |
|---|---|
| protected byte[] _binaryValue We will hold on to decoded binary data, for duration of
current event, so that multiple calls to
| |
| _byteArrayBuilder | back to summary |
|---|---|
| protected ByteArrayBuilder _byteArrayBuilder ByteArrayBuilder is needed if 'getBinaryValue' is called. If so, we better reuse it for remainder of content. | |
| _currInputProcessed | back to summary |
|---|---|
| protected long _currInputProcessed Number of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer). | |
| _currInputRow | back to summary |
|---|---|
| protected int _currInputRow Current row location of current point in input buffer, starting from 1, if available. | |
| _currInputRowStart | back to summary |
|---|---|
| protected int _currInputRowStart 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. | |
| _expLength | back to summary |
|---|---|
| protected int _expLength Length of the exponent part of the number, if any, not including 'e' marker or sign, just digits. Not used for pure integer values. | |
| _fractLength | back to summary |
|---|---|
| protected int _fractLength Length of the fractional part (not including decimal point or exponent), in characters. Not used for pure integer values. | |
| _inputEnd | back to summary |
|---|---|
| protected int _inputEnd Index of character after last available one in the buffer. | |
| _inputPtr | back to summary |
|---|---|
| protected int _inputPtr Pointer to next available character in buffer | |
| _intLength | back to summary |
|---|---|
| protected int _intLength Length of integer part of the number, in characters | |
| _numberBigDecimal | back to summary |
|---|---|
| protected BigDecimal _numberBigDecimal | |
| _numberBigInt | back to summary |
|---|---|
| protected BigInteger _numberBigInt | |
| _numberDouble | back to summary |
|---|---|
| protected double _numberDouble | |
| _numberFloat | back to summary |
|---|---|
| protected float _numberFloat | |
| _numberInt | back to summary |
|---|---|
| protected int _numberInt | |
| _numberIsNaN | back to summary |
|---|---|
| protected boolean _numberIsNaN Marker for explicit "Not a Number" (NaN) values that may be read by some formats: this includes positive and negative infinity, as well as "NaN" result for some arithmetic operations. In case of JSON, such values can only be handled with non-standard processing: for some other formats they can be passed normally. Note this marker is NOT set in case of value overflow/underflow for
| |
| _numberLong | back to summary |
|---|---|
| protected long _numberLong | |
| _numberNegative | back to summary |
|---|---|
| protected boolean _numberNegative Flag that indicates whether numeric value has a negative value. That is, whether its textual representation starts with minus character. | |
| _numberString | back to summary |
|---|---|
| protected String _numberString Textual number representation captured from input in cases lazy-parsing is desired. | |
| _numTypesValid | back to summary |
|---|---|
| protected int _numTypesValid Bitfield that indicates which numeric representations have been calculated for the current type | |
| _textBuffer | back to summary |
|---|---|
| protected final TextBuffer _textBuffer Buffer that contains contents of String values, including property names if necessary (name split across boundary, contains escape sequence, or access needed to char array) | |
| _tokenInputCol | back to summary |
|---|---|
| protected int _tokenInputCol Column on input row that current token starts; 0-based (although in the end it'll be converted to 1-based) | |
| _tokenInputRow | back to summary |
|---|---|
| protected int _tokenInputRow Input row on which current token starts, 1-based | |
| _tokenInputTotal | back to summary |
|---|---|
| protected long _tokenInputTotal 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. | |
| ParserBase | back to summary |
|---|---|
| protected ParserBase(ObjectReadContext readCtxt, IOContext ctxt, int streamReadFeatures) | |
| _contentReference | back to summary |
|---|---|
| protected ContentReference _contentReference() Helper method used to encapsulate logic of including (or not) of
"content reference" when constructing
| |
| _contentReferenceRedacted | back to summary |
|---|---|
| protected ContentReference _contentReferenceRedacted() Helper method used to encapsulate logic of providing
"content reference" when constructing
Default implementation will simply return
| |
| _convertBigDecimalToBigInteger | back to summary |
|---|---|
| protected BigInteger _convertBigDecimalToBigInteger(BigDecimal bigDec) | |
| _decodeBase64Escape | back to summary |
|---|---|
| protected final int _decodeBase64Escape(Base64Variant b64variant, int ch, int index) throws JacksonException | |
| _decodeBase64Escape | back to summary |
|---|---|
| protected final int _decodeBase64Escape(Base64Variant b64variant, char ch, int index) throws JacksonException | |
| _decodeEscaped | back to summary |
|---|---|
| protected char _decodeEscaped() throws JacksonException 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
| |
| _eofAsNextChar | back to summary |
|---|---|
protected final int _eofAsNextChar() throws StreamReadException
| |
| _getBigDecimal | back to summary |
|---|---|
| protected BigDecimal _getBigDecimal() Internal accessor that needs to be used for accessing number value of type
| |
| _getBigInteger | back to summary |
|---|---|
| protected BigInteger _getBigInteger() Internal accessor that needs to be used for accessing number value of type
| |
| _getByteArrayBuilder | back to summary |
|---|---|
| protected ByteArrayBuilder _getByteArrayBuilder() | |
| _getNumberDouble | back to summary |
|---|---|
| protected double _getNumberDouble() Internal accessor that needs to be used for accessing number value of type
| |
| _getNumberFloat | back to summary |
|---|---|
| protected float _getNumberFloat() Internal accessor that needs to be used for accessing number value of type
| |
| _growNameDecodeBuffer | back to summary |
|---|---|
| protected int[] _growNameDecodeBuffer(int[] arr, int more) throws StreamConstraintsException | |
| _handleBase64MissingPadding | back to summary |
|---|---|
| protected <T> T _handleBase64MissingPadding(Base64Variant b64variant) throws StreamReadException | |
| _handleEOF | back to summary |
|---|---|
| protected void _handleEOF() throws JacksonException Implements abstract tools. Method called when an EOF is encountered between tokens. If so, it may be a legitimate EOF, but only if there is no open non-root context.
| |
| _parseIntValue | back to summary |
|---|---|
| protected abstract int _parseIntValue() throws JacksonException | |
| _parseNumericValue | back to summary |
|---|---|
| protected abstract void _parseNumericValue(int expType) throws JacksonException, InputCoercionException 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.
| |
| _releaseBuffers | back to summary |
|---|---|
| protected void _releaseBuffers() Implements abstract tools. Doc from tools. Method called to release internal buffers owned by the base
reader. This is expected to be called after
| |
| _reportInvalidBase64Char | back to summary |
|---|---|
| protected <T> T _reportInvalidBase64Char(Base64Variant b64variant, int ch, int bindex) throws StreamReadException | |
| _reportInvalidBase64Char | back to summary |
|---|---|
| protected <T> T _reportInvalidBase64Char(Base64Variant b64variant, int ch, int bindex, String msg) throws StreamReadException | |
| assignCurrentValue | back to summary |
|---|---|
| public void assignCurrentValue(Object v) Implements abstract tools. Doc from tools. Helper method, usually equivalent to:
| |
| close | back to summary |
|---|---|
| public void close() throws JacksonException Overrides tools. Implements java. Method that can be called to get the name associated with the current event.
| |
| convertNumberToBigDecimal | back to summary |
|---|---|
| protected void convertNumberToBigDecimal() | |
| convertNumberToBigInteger | back to summary |
|---|---|
| protected void convertNumberToBigInteger() | |
| convertNumberToDouble | back to summary |
|---|---|
| protected void convertNumberToDouble() | |
| convertNumberToFloat | back to summary |
|---|---|
| protected void convertNumberToFloat() | |
| convertNumberToInt | back to summary |
|---|---|
| protected void convertNumberToInt() throws InputCoercionException | |
| convertNumberToLong | back to summary |
|---|---|
| protected void convertNumberToLong() throws InputCoercionException | |
| currentValue | back to summary |
|---|---|
| public Object currentValue() Implements abstract tools. Doc from tools. Helper 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. The reason it is included here is that it can be stored and accessed hierarchically, and gets passed through data-binding.
| |
| getBigIntegerValue | back to summary |
|---|---|
| public BigInteger getBigIntegerValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type
| |
| getBinaryValue | back to summary |
|---|---|
| public byte[] getBinaryValue(Base64Variant variant) throws JacksonException Implements abstract tools. Doc from tools. 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.
It works similar to getting String value via Note that non-decoded textual contents of the current token are not guaranteed to be accessible after this method is called. Current implementation, for example, clears up textual content during decoding. Decoded binary content, however, will be retained until parser is advanced to the next event.
| |
| getDecimalValue | back to summary |
|---|---|
| public BigDecimal getDecimalValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type
| |
| getDoubleValue | back to summary |
|---|---|
| public double getDoubleValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type Note if the value falls
outside of range of Java double, a
| |
| getFloatValue | back to summary |
|---|---|
| public float getFloatValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type Note if the value falls
outside of range of Java float, a
| |
| getIntValue | back to summary |
|---|---|
| public int getIntValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type Note if the resulting integer value falls outside range of
Java
| |
| getLongValue | back to summary |
|---|---|
| public long getLongValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type Note if the token is an integer, but its value falls
outside of range of Java long, a
| |
| getNumberType | back to summary |
|---|---|
| public JsonParser. Implements abstract tools. Doc from tools. If current token is of type
Note in Jackson 2.x, an exception was wrong if called for non-numeric token.
| |
| getNumberValue | back to summary |
|---|---|
| public Number getNumberValue() Implements abstract tools. Doc from tools. 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.
| |
| getNumberValueDeferred | back to summary |
|---|---|
| public Object getNumberValueDeferred() Overrides tools. Doc from tools. Method similar to
Same constraints apply to calling this method as to
Default implementation simply returns
| |
| getNumberValueExact | back to summary |
|---|---|
| public Number getNumberValueExact() Overrides tools. Doc from tools. Method similar to
Default implementation simply returns
| |
| getTokenCharacterOffset | back to summary |
|---|---|
| public long getTokenCharacterOffset() | |
| getTokenColumnNr | back to summary |
|---|---|
| public int getTokenColumnNr() | |
| getTokenLineNr | back to summary |
|---|---|
| public int getTokenLineNr() | |
| growArrayBy | back to summary |
|---|---|
| protected static int[] growArrayBy(int[] arr, int more) throws IllegalArgumentException | |
| hasStringCharacters | back to summary |
|---|---|
| public boolean hasStringCharacters() Implements abstract tools. Doc from tools. Method that can be used to determine whether calling of
| |
| isNaN | back to summary |
|---|---|
| public boolean isNaN() Implements abstract tools. Doc from tools. Accessor for checking whether current token is a special
"not-a-number" (NaN) token (including both "NaN" AND
positive/negative infinity!). These values are not supported by all formats:
JSON, for example, only supports them if
Note in case where numeric value is outside range of requested type --
most notably
| |
| reset | back to summary |
|---|---|
| protected final JsonToken reset(boolean negative, int intLen, int fractLen, int expLen) throws JacksonException | |
| resetAsNaN | back to summary |
|---|---|
| protected final JsonToken resetAsNaN(String valueStr, double value) | |
| resetFloat | back to summary |
|---|---|
| protected final JsonToken resetFloat(boolean negative, int intLen, int fractLen, int expLen) throws JacksonException | |
| resetInt | back to summary |
|---|---|
| protected final JsonToken resetInt(boolean negative, int intLen) throws JacksonException | |