package com.fasterxml.jackson.core.base;
I/O context for this reader. It handles buffer allocation
for the reader.
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.
Pointer to next available character in buffer
Index of character after last available one in the buffer.
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.
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.
Input row on which current token starts, 1-based
Column on input row that current token starts; 0-based (although
in the end it'll be converted to 1-based)
Information about parser context, context in which
the next token is to be parsed (root, array, object).
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.
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)
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)
ByteArrayBuilder is needed if 'getBinaryValue' is called. If so,
we better reuse it for remainder of content.
final protected static int NR_INT = 0x0001;
final protected static int NR_LONG = 0x0002;
final protected static int NR_BIGINT = 0x0004;
final protected static int NR_DOUBLE = 0x008;
final protected static int INT_0 = '0';
final protected static int INT_1 = '1';
final protected static int INT_2 = '2';
final protected static int INT_3 = '3';
final protected static int INT_4 = '4';
final protected static int INT_5 = '5';
final protected static int INT_6 = '6';
final protected static int INT_7 = '7';
final protected static int INT_8 = '8';
final protected static int INT_9 = '9';
final protected static int INT_PLUS = '+';
final protected static int INT_e = 'e';
final protected static int INT_E = 'E';
final protected static char CHAR_NULL = '\0';
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.
Length of integer part of the number, in characters
Length of the fractional part (not including decimal
point or exponent), in characters.
Not used for pure integer values.
Length of the exponent part of the number, if any, not
including 'e' marker or sign, just digits.
Not used for pure integer values.
Method that can be called to get the name associated with
the current event.
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 returns location of the last processed character;
usually for error reporting purposes
return (col < 0) ? col : (col + 1);
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).
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.
protected final JsonToken reset(boolean negative, int intLen, int fractLen, int expLen)
if (fractLen < 1 && expLen < 1) {
return resetFloat(negative, intLen, fractLen, expLen);
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.
- Parameters:
expType
Numeric type that we will immediately need, if any;
mostly necessary to optimize handling of floating point numbers
int i = NumberInput.parseInt(buf, offset, len);
long l = NumberInput.parseLong(buf, offset, len);
_wrapError("Malformed numeric value '"+numStr+"'", nex);
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
- Parameters:
bindex
Relative index within base64 character unit; between 0
and 3 (as unit has exactly 4 characters)
base = "Illegal white space character (code 0x"+Integer.toHexString(ch)+") as character #"+(bindex+1)+" of 4-char base64 unit: can only used between units";
base = "Unexpected padding character ('"+b64variant.getPaddingChar()+"') as character #"+(bindex+1)+" of 4-char base64 unit: padding only legal as 3rd or 4th character";
base = "Illegal character (code 0x"+Integer.toHexString(ch)+") in base64 content";
base = "Illegal character '"+((char)ch)+"' (code 0x"+Integer.toHexString(ch)+") in base64 content";
base = base + ": " + msg;