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

public abstract Class ParserMinimalBase

extends JsonParser
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.core.base.ParserBase
Imports
java.io.IOException, java.math.BigDecimal, .BigInteger, com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.exc.InputCoercionException, com.fasterxml.jackson.core.io.JsonEOFException, .NumberInput, com.fasterxml.jackson.core.util.ByteArrayBuilder, .VersionUtil

Intermediate base class used by all Jackson JsonParser implementations, but does not add any additional fields that depend on particular method of obtaining input.

Note that 'minimal' here mostly refers to minimal number of fields (size) and functionality that is specific to certain types of parser implementations; but not necessarily to number of methods.

Field Summary

Modifier and TypeField and Description
protected JsonToken
_currToken

Last token retrieved via nextToken, if any.

protected JsonToken
_lastClearedToken

Last cleared token, if any: that is, value that was in effect when clearCurrentToken was called.

protected static final BigDecimal
protected static final BigDecimal
protected static final BigDecimal
protected static final BigDecimal
protected static final BigInteger
protected static final BigInteger
protected static final BigInteger
protected static final BigInteger
protected static final char
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
MAX_ERROR_TOKEN_LENGTH

Maximum number of characters to include in token reported as part of error messages.

protected static final double
protected static final long
protected static final double
protected static final double
protected static final long
protected static final double
protected static final byte[]
protected static final int[]
protected static final int
protected static final int
protected static final int
protected static final int
NR_FLOAT

Note

Not used by JSON implementation but used by many of binary codecs

protected static final int
protected static final int
protected static final int
Inherited from com.fasterxml.jackson.core.JsonParser:
_features_requestPayloadDEFAULT_READ_CAPABILITIES

Constructor Summary

AccessConstructor and Description
protected
protected
ParserMinimalBase(int features)

Method Summary

Modifier and TypeMethod and Description
protected static String
_ascii(byte[] b)

Deprecated
protected static byte[]
_asciiBytes(String str)

Deprecated
protected final JsonParseException
protected void
_decodeBase64(String
String to decode
str
,
ByteArrayBuilder
Builder used to buffer binary content decoded
builder
,
Base64Variant
Base64 variant expected in content
b64variant
)

Helper method that can be used for base64 decoding in cases where encoded content has already been read as a String.

protected static final String
_getCharDesc(int ch)

protected abstract void
_handleEOF()

Method sub-classes need to implement for verifying that end-of-content is acceptable at current input position.

protected boolean

Returns:

True if given value contains "null equivalent" String value (for content this parser handles).
_hasTextualNull
(String
String value to check
value
)

Helper method used to determine whether we are currently pointing to a String value of "null" (NOT a null token); and, if so, that parser is to recognize and return it similar to if it was real null token.

protected String
protected String
protected final void
protected final void
protected final void
_reportError(String msg, Object arg1, Object arg2)

protected void
_reportInputCoercion(String msg, JsonToken inputType, Class<?> targetType)

protected void
protected void
protected void
_reportInvalidEOF(String
Addition message snippet to append to base exception message
msg
)

Deprecated Since 2.8 use _reportInvalidEOF(String, JsonToken) instead
protected void
protected void
protected void
protected void
_reportUnexpectedChar(int ch, String comment)

protected <T> T
_reportUnexpectedNumberChar(int
Character that was unexpected
ch
,
String
Additional failure comment to add, if any
comment
)

protected final void
protected void
protected final void
public void
clearCurrentToken()

Implements abstract com.fasterxml.jackson.core.JsonParser.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.

Implements abstract com.fasterxml.jackson.core.JsonParser.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 JsonToken
currentToken()

Overrides com.fasterxml.jackson.core.JsonParser.currentToken.

Accessor to find which token parser currently points to, if any; null will be returned if none.
public int
currentTokenId()

Overrides com.fasterxml.jackson.core.JsonParser.currentTokenId.

Method similar to getCurrentToken() but that returns an int instead of JsonToken (enum value).
public abstract byte[]
getBinaryValue(Base64Variant
Expected variant of base64 encoded content (see Base64Variants for definitions of "standard" variants).
b64variant
)

Implements abstract com.fasterxml.jackson.core.JsonParser.getBinaryValue.

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 abstract String
public JsonToken
getCurrentToken()

Implements abstract com.fasterxml.jackson.core.JsonParser.getCurrentToken.

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

Implements abstract com.fasterxml.jackson.core.JsonParser.getLastClearedToken.

Method that can be called to get the last token that was cleared using clearCurrentToken.
public abstract JsonStreamContext
getParsingContext()

Implements abstract com.fasterxml.jackson.core.JsonParser.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 abstract String
getText()

Implements abstract com.fasterxml.jackson.core.JsonParser.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 abstract char[]
getTextCharacters()

Implements abstract com.fasterxml.jackson.core.JsonParser.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
getTextLength()

Implements abstract com.fasterxml.jackson.core.JsonParser.getTextLength.

Accessor used with getTextCharacters, to know length of String stored in returned buffer.
public abstract int
getTextOffset()

Implements abstract com.fasterxml.jackson.core.JsonParser.getTextOffset.

Accessor used with getTextCharacters, to know offset of the first text content character within buffer.
public boolean
getValueAsBoolean(boolean
Default value to return if conversion to boolean is not possible
defaultValue
)

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsBoolean.

Method that will try to convert value of current token to a boolean.
public double
getValueAsDouble(double
Default value to return if conversion to double is not possible
defaultValue
)

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsDouble.

Method that will try to convert value of current token to a Java double.
public int
getValueAsInt()

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsInt.

Method that will try to convert value of current token to a Java int value.
public int
getValueAsInt(int
Default value to return if conversion to int is not possible
defaultValue
)

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsInt.

Method that will try to convert value of current token to a int.
public long
getValueAsLong()

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsLong.

Method that will try to convert value of current token to a long.
public long
getValueAsLong(long
Default value to return if conversion to long is not possible
defaultValue
)

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsLong.

Method that will try to convert value of current token to a long.
public String
getValueAsString()

Overrides com.fasterxml.jackson.core.JsonParser.getValueAsString.

Method that will try to convert value of current token to a java.lang.String.
public String
getValueAsString(String
Default value to return if conversion to String is not possible
defaultValue
)

Implements abstract com.fasterxml.jackson.core.JsonParser.getValueAsString.

Method that will try to convert value of current token to a java.lang.String.
public boolean
hasCurrentToken()

Implements abstract com.fasterxml.jackson.core.JsonParser.hasCurrentToken.

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

Implements abstract com.fasterxml.jackson.core.JsonParser.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 boolean
hasToken(JsonToken
Token to match
t
)

Implements abstract com.fasterxml.jackson.core.JsonParser.hasToken.

Method that is functionally equivalent to: return currentToken() == t but may be more efficiently implemented.
public boolean
hasTokenId(int
Token id to match (from (@link JsonTokenId})
id
)

Implements abstract com.fasterxml.jackson.core.JsonParser.hasTokenId.

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

Implements abstract com.fasterxml.jackson.core.JsonParser.isClosed.

Method that can be called to determine whether this parser is closed or not.
public boolean
public boolean
isExpectedStartArrayToken()

Overrides com.fasterxml.jackson.core.JsonParser.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
public abstract JsonToken
nextToken()

Implements abstract com.fasterxml.jackson.core.JsonParser.nextToken.

Main iteration method, which will advance stream enough to determine type of the next token, if any.
public JsonToken
nextValue()

Implements abstract com.fasterxml.jackson.core.JsonParser.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
)

Implements abstract com.fasterxml.jackson.core.JsonParser.overrideCurrentName.

Method that can be used to change what is considered to be the current (field) name.
protected void
reportInvalidNumber(String
Base exception message to use
msg
)

Method called to throw an exception for input token that looks like a number based on first character(s), but is not valid according to rules of format.

protected void
reportOverflowInt()

Method called to throw an exception for integral (not floating point) input token with value outside of Java signed 32-bit range when requested as int.

protected void
protected void
reportOverflowInt(String numDesc, JsonToken inputType)

protected void
reportOverflowLong()

Method called to throw an exception for integral (not floating point) input token with value outside of Java signed 64-bit range when requested as long.

protected void
protected void
reportOverflowLong(String numDesc, JsonToken inputType)

protected void
reportUnexpectedNumberChar(int ch, String comment)

Deprecated
public JsonParser
skipChildren()

Implements abstract com.fasterxml.jackson.core.JsonParser.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.
Inherited from com.fasterxml.jackson.core.JsonParser:
_codec_constructError_constructReadException_constructReadException_constructReadException_constructReadException_constructReadException_reportUnsupportedOperationassignCurrentValuecanParseAsynccanReadObjectIdcanReadTypeIdcanUseSchemaconfigurecurrentLocationcurrentNamecurrentTokenLocationcurrentValuedisableenablefinishTokengetBigIntegerValuegetBinaryValuegetBooleanValuegetByteValuegetCodecgetCurrentLocationgetCurrentValuegetDecimalValuegetDoubleValuegetEmbeddedObjectgetFeatureMaskgetFloatValuegetFormatFeaturesgetInputSourcegetIntValuegetLongValuegetNonBlockingInputFeedergetNumberTypegetNumberValuegetNumberValueDeferredgetNumberValueExactgetObjectIdgetReadCapabilitiesgetSchemagetShortValuegetTextgetTokenLocationgetTypeIdgetValueAsBooleangetValueAsDoubleisEnabledisEnabledisNaNnextBooleanValuenextFieldNamenextFieldNamenextIntValuenextLongValuenextTextValueoverrideFormatFeaturesoverrideStdFeaturesreadBinaryValuereadBinaryValuereadValueAsreadValueAsreadValueAsTreereadValuesAsreadValuesAsreleaseBufferedreleaseBufferedrequiresCustomCodecsetCodecsetCurrentValuesetFeatureMasksetRequestPayloadOnErrorsetRequestPayloadOnErrorsetRequestPayloadOnErrorsetSchemastreamReadConstraintsversion