Top Description Fields Constructors Methods
tools.jackson.core.util

public Class JsonParserDelegate

extends JsonParser
Class Inheritance
Known Direct Subclasses
tools.jackson.core.util.JsonParserSequence, tools.jackson.core.filter.FilteringParserDelegate
Imports
java.io.OutputStream, .Writer, java.math.BigDecimal, .BigInteger, tools.jackson.core.*, tools.jackson.core.async.NonBlockingInputFeeder, tools.jackson.core.exc.InputCoercionException, tools.jackson.core.sym.PropertyNameMatcher, tools.jackson.core.type.ResolvedType, .TypeReference

Helper class that implements delegation pattern for JsonParser, to allow for simple overridability of basic parsing functionality. The idea is that any functionality to be modified can be simply overridden; and anything else will be delegated by default.

Field Summary

Modifier and TypeField and Description
protected JsonParser
delegate

Delegate object that method calls are delegated to.

Inherited from tools.jackson.core.JsonParser:
DEFAULT_READ_CAPABILITIES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
assignCurrentValue(Object v)

Implements abstract tools.jackson.core.JsonParser.assignCurrentValue.

Helper method, usually equivalent to: getParsingContext().assignCurrentValue(v);

public boolean
canParseAsync()

Overrides tools.jackson.core.JsonParser.canParseAsync.

Method that can be called to determine if this parser instance uses non-blocking ("asynchronous") input access for decoding or not.

public boolean
canReadObjectId()

Overrides tools.jackson.core.JsonParser.canReadObjectId.

Introspection 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
canReadTypeId()

Overrides tools.jackson.core.JsonParser.canReadTypeId.

Introspection 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 void
clearCurrentToken()

Implements abstract tools.jackson.core.JsonParser.clearCurrentToken.

Method called to "consume" the current token by effectively removing it so that hasCurrentToken returns false, and currentToken null).

public void
close()

Implements abstract tools.jackson.core.JsonParser.close.

Implements java.io.Closeable.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 StreamReadFeature#AUTO_CLOSE_SOURCE is enabled.

public TokenStreamLocation
currentLocation()

Implements abstract tools.jackson.core.JsonParser.currentLocation.

Method that returns location of the last processed character; usually for error reporting purposes.

public String
currentName()

Implements abstract tools.jackson.core.JsonParser.currentName.

Method that can be called to get the name associated with the current token: for JsonToken#PROPERTY_NAMEs it will be the same as what getString() returns; for Object property values it will be the preceding property name; and for others (array element, root-level values) null.

public int
currentNameMatch(PropertyNameMatcher matcher)

Implements abstract tools.jackson.core.JsonParser.currentNameMatch.

Method that verifies that the current token (see currentToken) is JsonToken#PROPERTY_NAME and if so, further match that associated name (see currentName) to one of pre-specified (property) names.

public JsonToken
currentToken()

Implements abstract tools.jackson.core.JsonParser.currentToken.

Accessor to find which token parser currently points to, if any; null will be returned if none.

public long
currentTokenCount()

Implements abstract tools.jackson.core.JsonParser.currentTokenCount.

Get an approximate count of the number of tokens that have been read.

public int
currentTokenId()

Implements abstract tools.jackson.core.JsonParser.currentTokenId.

Method similar to currentToken() but that returns an int instead of JsonToken (enum value).

public TokenStreamLocation
currentTokenLocation()

Implements abstract tools.jackson.core.JsonParser.currentTokenLocation.

Method that return the starting location of the current token; that is, position of the first character from input that starts the current token.

public Object
currentValue()

Implements abstract tools.jackson.core.JsonParser.currentValue.

Helper method, usually equivalent to: getParsingContext().currentValue();

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:

Underlying parser calls are delegated to
delegate
()

Accessor for getting the immediate JsonParser this parser delegates calls to.

public void
finishToken()

Implements abstract tools.jackson.core.JsonParser.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 BigInteger
getBigIntegerValue()

Implements abstract tools.jackson.core.JsonParser.getBigIntegerValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it cannot be used as a Java long primitive type due to its magnitude.

public byte[]
getBinaryValue(Base64Variant b64variant)

Implements abstract tools.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 boolean
getBooleanValue()

Implements abstract tools.jackson.core.JsonParser.getBooleanValue.

Convenience accessor that can be called when the current token is JsonToken#VALUE_TRUE or JsonToken#VALUE_FALSE, to return matching boolean value.

public byte
getByteValue()

Implements abstract tools.jackson.core.JsonParser.getByteValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a value of Java byte primitive type.

public BigDecimal
getDecimalValue()

Implements abstract tools.jackson.core.JsonParser.getDecimalValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_FLOAT or JsonToken#VALUE_NUMBER_INT.

public double
getDoubleValue()

Implements abstract tools.jackson.core.JsonParser.getDoubleValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_FLOAT and it can be expressed as a Java double primitive type.

public Object
getEmbeddedObject()

Implements abstract tools.jackson.core.JsonParser.getEmbeddedObject.

Accessor that can be called if (and only if) the current token is JsonToken#VALUE_EMBEDDED_OBJECT.

public float
getFloatValue()

Implements abstract tools.jackson.core.JsonParser.getFloatValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_FLOAT and it can be expressed as a Java float primitive type.

public int
getIntValue()

Implements abstract tools.jackson.core.JsonParser.getIntValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a value of Java int primitive type.

public JsonToken
getLastClearedToken()

Implements abstract tools.jackson.core.JsonParser.getLastClearedToken.

Method that can be called to get the last token that was cleared using clearCurrentToken.

public long
getLongValue()

Implements abstract tools.jackson.core.JsonParser.getLongValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a Java long primitive type.

public JsonParser.NumberType
getNumberType()

Implements abstract tools.jackson.core.JsonParser.getNumberType.

If current token is of type JsonToken#VALUE_NUMBER_INT or JsonToken#VALUE_NUMBER_FLOAT, returns one of NumberType constants; otherwise returns null.

public JsonParser.NumberTypeFP
getNumberTypeFP()

Implements abstract tools.jackson.core.JsonParser.getNumberTypeFP.

If current token is of type JsonToken#VALUE_NUMBER_FLOAT, returns one of NumberTypeFP constants; otherwise returns NumberTypeFP#UNKNOWN.

public Number
getNumberValue()

Implements abstract tools.jackson.core.JsonParser.getNumberValue.

Generic number value accessor method that will work for all kinds of numeric values.

public Object
getNumberValueDeferred()

Implements abstract tools.jackson.core.JsonParser.getNumberValueDeferred.

Method similar to getNumberValue but that returns either same Number value as getNumberValue() (if already decoded), or String representation of as-of-yet undecoded number.

public Number
getNumberValueExact()

Implements abstract tools.jackson.core.JsonParser.getNumberValueExact.

Method similar to getNumberValue with the difference that for floating-point numbers value returned may be BigDecimal if the underlying format does not store floating-point numbers using native representation: for example, textual formats represent numbers as Strings (which are 10-based), and conversion to java.lang.Double is potentially lossy operation.

public Object
getObjectId()

Overrides tools.jackson.core.JsonParser.getObjectId.

Method 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 FormatSchema
getSchema()

Overrides tools.jackson.core.JsonParser.getSchema.

Method for accessing Schema that this parser uses, if any.

public short
getShortValue()

Implements abstract tools.jackson.core.JsonParser.getShortValue.

Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a value of Java short primitive type.

public String
getString()

Implements abstract tools.jackson.core.JsonParser.getString.

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 int
getString(Writer writer)

Implements abstract tools.jackson.core.JsonParser.getString.

Method to read the textual representation of the current token in chunks and pass it to the given Writer.

public char[]
getStringCharacters()

Implements abstract tools.jackson.core.JsonParser.getStringCharacters.

Method similar to getString(), but that will return underlying (unmodifiable) character array that contains textual value, instead of constructing a String object to contain this information.

public int
getStringLength()

Implements abstract tools.jackson.core.JsonParser.getStringLength.

Accessor used with getStringCharacters, to know length of String stored in returned buffer.

public int
getStringOffset()

Implements abstract tools.jackson.core.JsonParser.getStringOffset.

Accessor used with getStringCharacters, to know offset of the first text content character within buffer.

public Object
getTypeId()

Overrides tools.jackson.core.JsonParser.getTypeId.

Method 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
getValueAsBoolean()

Overrides tools.jackson.core.JsonParser.getValueAsBoolean.

Method that will try to convert value of current token to a boolean.

public boolean
getValueAsBoolean(boolean defaultValue)

Implements abstract tools.jackson.core.JsonParser.getValueAsBoolean.

Method that will try to convert value of current token to a boolean.

public double
getValueAsDouble()

Overrides tools.jackson.core.JsonParser.getValueAsDouble.

Method that will try to convert value of current token to a Java double.

public double
getValueAsDouble(double defaultValue)

Overrides tools.jackson.core.JsonParser.getValueAsDouble.

Method that will try to convert value of current token to a Java double.

public int
getValueAsInt()

Overrides tools.jackson.core.JsonParser.getValueAsInt.

Method that will try to convert value of current token to a Java int value.

public int
getValueAsInt(int defaultValue)

Overrides tools.jackson.core.JsonParser.getValueAsInt.

Method that will try to convert value of current token to a int.

public long
getValueAsLong()

Overrides tools.jackson.core.JsonParser.getValueAsLong.

Method that will try to convert value of current token to a long.

public long
getValueAsLong(long defaultValue)

Overrides tools.jackson.core.JsonParser.getValueAsLong.

Method that will try to convert value of current token to a long.

public String
getValueAsString()

Overrides tools.jackson.core.JsonParser.getValueAsString.

Method that will try to convert value of current token to a java.lang.String.

public String
getValueAsString(String defaultValue)

Implements abstract tools.jackson.core.JsonParser.getValueAsString.

Method that will try to convert value of current token to a java.lang.String.

public boolean
hasCurrentToken()

Implements abstract tools.jackson.core.JsonParser.hasCurrentToken.

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

public boolean
hasStringCharacters()

Implements abstract tools.jackson.core.JsonParser.hasStringCharacters.

Method that can be used to determine whether calling of getStringCharacters would be the most efficient way to access String value for the event parser currently points to (compared to getString()).

public boolean
hasToken(JsonToken t)

Implements abstract tools.jackson.core.JsonParser.hasToken.

Method that is functionally equivalent to: return currentToken() == t but may be more efficiently implemented.

public boolean
hasTokenId(int id)

Implements abstract tools.jackson.core.JsonParser.hasTokenId.

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

public boolean
isClosed()

Implements abstract tools.jackson.core.JsonParser.isClosed.

Method that can be called to determine whether this parser is closed or not.

public boolean
isEnabled(StreamReadFeature f)

Implements abstract tools.jackson.core.JsonParser.isEnabled.

Method for checking whether specified StreamReadFeature is enabled.

public boolean
public boolean
isExpectedStartArrayToken()

Implements abstract tools.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 boolean
isNaN()

Implements abstract tools.jackson.core.JsonParser.isNaN.

Accessor for checking whether current token is a special "not-a-number" (NaN) token (including both "NaN" AND positive/negative infinity!).

public String
nextName()

Implements abstract tools.jackson.core.JsonParser.nextName.

Method that fetches next token (as if calling nextToken) and verifies whether it is JsonToken#PROPERTY_NAME; if it is, returns same as currentName(), otherwise null.

public boolean
nextName(SerializableString str)

Implements abstract tools.jackson.core.JsonParser.nextName.

Method that fetches next token (as if calling nextToken) and verifies whether it is JsonToken#PROPERTY_NAME with specified name and returns result of that comparison.

public int
nextNameMatch(PropertyNameMatcher matcher)

Implements abstract tools.jackson.core.JsonParser.nextNameMatch.

Method that tries to match next token from stream as JsonToken#PROPERTY_NAME, and if so, further match it to one of pre-specified (field) names.

public JsonToken
nextToken()

Implements abstract tools.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 tools.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 NonBlockingInputFeeder
nonBlockingInputFeeder()

Overrides tools.jackson.core.JsonParser.nonBlockingInputFeeder.

Method that will either return a feeder instance (if parser uses non-blocking, aka asynchronous access); or null for parsers that use blocking I/O.

public ObjectReadContext
objectReadContext()

Implements abstract tools.jackson.core.JsonParser.objectReadContext.

Accessor for context object provided by higher level data-binding functionality (or, in some cases, simple placeholder of the same) that allows some level of interaction including ability to trigger deserialization of Object values through generator instance.

public int
readBinaryValue(Base64Variant b64variant, OutputStream out)

Overrides tools.jackson.core.JsonParser.readBinaryValue.

Similar to readBinaryValue(OutputStream) but allows explicitly specifying base64 variant to use.

public <T> T
readValueAs(Class<T> valueType)

Implements abstract tools.jackson.core.JsonParser.readValueAs.

Method to deserialize stream content into a non-container type (it can be an array type, however): typically a bean, array or a wrapper type (like java.lang.Boolean)

Note

method can only be called if the parser has been constructed with a linkage to ObjectReadContext; this is true if constructed by databinding layer above, or by factory method that takes in context object.

public <T> T
readValueAs(TypeReference<T> valueTypeRef)

Implements abstract tools.jackson.core.JsonParser.readValueAs.

Method to deserialize stream content into a Java type, reference to which is passed as argument.

public <T> T
public <T extends TreeNode> T
readValueAsTree()

Implements abstract tools.jackson.core.JsonParser.readValueAsTree.

Method to deserialize stream content into equivalent "tree model", represented by root TreeNode of resulting model.

public JsonParser
skipChildren()

Implements abstract tools.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.

public JacksonFeatureSet<StreamReadCapability>
streamReadCapabilities()

Implements abstract tools.jackson.core.JsonParser.streamReadCapabilities.

Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly).

public StreamReadConstraints
streamReadConstraints()

Implements abstract tools.jackson.core.JsonParser.streamReadConstraints.

Get the constraints to apply when performing streaming reads.

public TokenStreamContext
streamReadContext()

Implements abstract tools.jackson.core.JsonParser.streamReadContext.

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 int
streamReadFeatures()

Implements abstract tools.jackson.core.JsonParser.streamReadFeatures.

Bulk access method for getting state of all standard StreamReadFeatures.

public Object
streamReadInputSource()

Implements abstract tools.jackson.core.JsonParser.streamReadInputSource.

Method that can be used to get access to object that is used to access input being parsed; this is usually either InputStream or Reader, depending on what parser was constructed with.

public Version
version()

Implements abstract tools.jackson.core.JsonParser.version.

Implements tools.jackson.core.Versioned.version.

Accessor for getting version of the core package, given a parser instance.

Inherited from tools.jackson.core.JsonParser:
_constructReadException_constructReadException_constructReadException_constructReadException_constructReadException_constructReadException_reportUnsupportedOperationgetBinaryValuegetTextgetTextCharactersgetTextLengthgetTextOffsetnextBooleanValuenextIntValuenextLongValuenextStringValuereadBinaryValuereleaseBufferedreleaseBuffered