Top Description Fields Constructors Methods
tools.jackson.dataformat.avro.deser

public abstract Class AvroParserImpl

extends AvroParser
Class Inheritance
Known Direct Subclasses
tools.jackson.dataformat.avro.deser.JacksonAvroParserImpl, tools.jackson.dataformat.avro.apacheimpl.ApacheAvroParserImpl
Imports
java.io.IOException, java.math.BigDecimal, .BigInteger, tools.jackson.core.*, tools.jackson.core.io.IOContext, tools.jackson.core.sym.PropertyNameMatcher, tools.jackson.dataformat.avro.AvroParser, .AvroSchema

Implementation base class that exposes additional internal API to be used as callbacks by AvroReadContext implementations.

Field Summary

Modifier and TypeField and Description
protected int
_branchIndex

Index of the union branch that was followed to reach the current token.

protected int
_enumIndex

Index of the enum that was read as the current token.

Inherited from tools.jackson.dataformat.avro.AvroParser:
_avroContext_formatFeatures_rootSchema_streamReadContextAVRO_READ_CAPABILITIES

Constructor Summary

AccessConstructor and Description
protected
AvroParserImpl(ObjectReadContext readCtxt, IOContext ioCtxt, int parserFeatures, int avroFeatures, AvroSchema schema)

Method Summary

Modifier and TypeMethod and Description
protected final void
public final void
public final int
public abstract boolean
public void
close()

Overrides tools.jackson.core.base.ParserBase.close.

Implements java.io.Closeable.close.

Method that can be called to get the name associated with the current event.

protected final void
protected final void
protected final void
protected final void
protected final void
protected final void
public abstract long
public abstract long
public abstract JsonToken
public abstract JsonToken
public JsonToken
decodeBytesDecimal(int scale)

public abstract JsonToken
public abstract int
public abstract JsonToken
decodeFixed(int size)

public JsonToken
decodeFixedDecimal(int scale, int size)

public abstract JsonToken
public abstract int
public abstract int
public abstract JsonToken
public abstract long
public abstract JsonToken
public abstract String
public abstract long
public abstract long
public abstract void
public abstract JsonToken
public final int
public final float
getFloatValue()

Overrides tools.jackson.core.base.ParserBase.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 final JsonParser.NumberType
getNumberType()

Overrides tools.jackson.core.base.ParserBase.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()

Overrides tools.jackson.core.base.ParserMinimalBase.getNumberTypeFP.

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

public final Number
getNumberValue()

Overrides tools.jackson.core.base.ParserBase.getNumberValue.

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

public final Number
getNumberValueExact()

Overrides tools.jackson.core.base.ParserBase.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 long
getRemainingElements()

Returns the remaining number of elements in the current block of a map or array

public final boolean
isNaN()

Overrides tools.jackson.core.base.ParserBase.isNaN.

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

public final boolean
public String
nextName()

Overrides tools.jackson.core.base.ParserMinimalBase.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 sstr)

Overrides tools.jackson.core.base.ParserMinimalBase.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)

Overrides tools.jackson.core.base.ParserMinimalBase.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 abstract String
nextStringValue()

Overrides tools.jackson.core.JsonParser.nextStringValue.

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_STRING returns contained String value; otherwise returns null.

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 final void
protected final JsonToken
setBytes(byte[] b)

protected final JsonToken
setNumber(int v)

protected final JsonToken
setNumber(long v)

protected final JsonToken
setNumber(float v)

protected final JsonToken
setNumber(double v)

protected abstract JsonToken
public abstract long

Returns:

Either 0, in which case all entries have been successfully skipped; or positive non-zero number to indicate elements that caller has to skip
skipArray
()

public abstract void
public abstract void
public void
public abstract void
public abstract void
skipFixed(int size)

public void
skipFixedDecimal(int size)

public abstract void
public abstract void
public abstract void
public abstract long

Returns:

Either 0, in which case all entries have been successfully skipped; or positive non-zero number to indicate map entries that caller has to skip
skipMap
()

public abstract void
public final void
skipValue()

Skip to the end of the current structure (array/map/object); This is different from skipMap() and skipArray() because it operates at the parser level instead of at the decoder level and advances the parsing context in addition to consuming the data from the input.

Inherited from tools.jackson.dataformat.avro.AvroParser:
_closeInput_parseIntValue_parseNumericValueassignCurrentValuecanReadTypeIdconfigurecurrentLocationcurrentNamecurrentTokenLocationcurrentValuedisableenablegetBinaryValuegetEmbeddedObjectgetSchemagetStringgetStringgetStringCharactersgetStringLengthgetStringOffsetgetTypeIdhasStringCharactersisEnabledsetSchemastreamReadCapabilitiesstreamReadContextstreamReadInputSourceversion

Field Detail

_branchIndexback to summary
protected int _branchIndex

Index of the union branch that was followed to reach the current token. This is cleared when the next token is read.

_enumIndexback to summary
protected int _enumIndex

Index of the enum that was read as the current token. This is cleared when the next token is read.

Constructor Detail

AvroParserImplback to summary
protected AvroParserImpl(ObjectReadContext readCtxt, IOContext ioCtxt, int parserFeatures, int avroFeatures, AvroSchema schema)

Method Detail

_checkNumericValueback to summary
protected final void _checkNumericValue() throws JacksonException
_initSchemaback to summary
public final void _initSchema(AvroSchema schema) throws JacksonException

Implements abstract tools.jackson.dataformat.avro.AvroParser._initSchema.

Annotations
@Override
branchIndexback to summary
public final int branchIndex()
checkInputEndback to summary
public abstract boolean checkInputEnd() throws IOException
closeback to summary
public void close()

Overrides tools.jackson.core.base.ParserBase.close.

Implements java.io.Closeable.close.

Doc from tools.jackson.core.base.ParserBase.close.

Method that can be called to get the name associated with the current event.

Annotations
@Override
convertNumberToBigDecimalback to summary
protected final void convertNumberToBigDecimal() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.convertNumberToBigDecimal.

Annotations
@Override
convertNumberToBigIntegerback to summary
protected final void convertNumberToBigInteger() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.convertNumberToBigInteger.

Annotations
@Override
convertNumberToDoubleback to summary
protected final void convertNumberToDouble() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.convertNumberToDouble.

Annotations
@Override
convertNumberToFloatback to summary
protected final void convertNumberToFloat() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.convertNumberToFloat.

Annotations
@Override
convertNumberToIntback to summary
protected final void convertNumberToInt() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.convertNumberToInt.

Annotations
@Override
convertNumberToLongback to summary
protected final void convertNumberToLong() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.convertNumberToLong.

Annotations
@Override
decodeArrayNextback to summary
public abstract long decodeArrayNext() throws IOException
decodeArrayStartback to summary
public abstract long decodeArrayStart() throws IOException
decodeBooleanback to summary
public abstract JsonToken decodeBoolean() throws IOException
decodeBytesback to summary
public abstract JsonToken decodeBytes() throws IOException
decodeBytesDecimalback to summary
public JsonToken decodeBytesDecimal(int scale) throws IOException
decodeDoubleback to summary
public abstract JsonToken decodeDouble() throws IOException
decodeEnumback to summary
public abstract int decodeEnum() throws IOException
decodeFixedback to summary
public abstract JsonToken decodeFixed(int size) throws IOException
decodeFixedDecimalback to summary
public JsonToken decodeFixedDecimal(int scale, int size) throws IOException
decodeFloatback to summary
public abstract JsonToken decodeFloat() throws IOException
decodeIndexback to summary
public abstract int decodeIndex() throws IOException
decodeIntback to summary
public abstract int decodeInt() throws IOException
decodeIntTokenback to summary
public abstract JsonToken decodeIntToken() throws IOException
decodeLongback to summary
public abstract long decodeLong() throws IOException
decodeLongTokenback to summary
public abstract JsonToken decodeLongToken() throws IOException
decodeMapKeyback to summary
public abstract String decodeMapKey() throws IOException
decodeMapNextback to summary
public abstract long decodeMapNext() throws IOException
decodeMapStartback to summary
public abstract long decodeMapStart() throws IOException
decodeStringback to summary
public abstract void decodeString() throws IOException
decodeStringTokenback to summary
public abstract JsonToken decodeStringToken() throws IOException
enumIndexback to summary
public final int enumIndex()
getFloatValueback to summary
public final float getFloatValue() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.getFloatValue.

Doc from 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. It can also be called for JsonToken#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 InputCoercionException will be thrown to indicate numeric overflow/underflow.

Annotations
@Override
getNumberTypeback to summary
public final JsonParser.NumberType getNumberType() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.getNumberType.

Doc from 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.

Note

in Jackson 2.x, an exception was wrong if called for non-numeric token.

Annotations
@Override
getNumberTypeFPback to summary
public JsonParser.NumberTypeFP getNumberTypeFP() throws JacksonException

Overrides tools.jackson.core.base.ParserMinimalBase.getNumberTypeFP.

Doc from tools.jackson.core.JsonParser.getNumberTypeFP.

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

Annotations
@Override
getNumberValueback to summary
public final Number getNumberValue() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.getNumberValue.

Doc from tools.jackson.core.JsonParser.getNumberValue.

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.

Annotations
@Override
getNumberValueExactback to summary
public final Number getNumberValueExact() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.getNumberValueExact.

Doc from 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.

Default implementation simply returns getNumberValue()

Annotations
@Override
getRemainingElementsback to summary
public long getRemainingElements()

Returns the remaining number of elements in the current block of a map or array

isNaNback to summary
public final boolean isNaN()

Overrides tools.jackson.core.base.ParserBase.isNaN.

Doc from 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!). These values are not supported by all formats: JSON, for example, only supports them if JsonReadFeature#ALLOW_NON_NUMERIC_NUMBERS is enabled.

Note

in case where numeric value is outside range of requested type -- most notably java.lang.Float or java.lang.Double -- and decoding results effectively in a NaN value, this method DOES NOT return true: only explicit incoming markers do. This is because value could still be accessed as a valid BigDecimal.

Annotations
@Override
isRecordback to summary
public final boolean isRecord()
nextNameback to summary
public String nextName() throws JacksonException

Overrides tools.jackson.core.base.ParserMinimalBase.nextName.

Doc from 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.

Note

in Jackson 2.x method was called nextFieldName()

Annotations
@Override
Exceptions
JacksonException:
for low-level read issues
nextNameback to summary
public boolean nextName(SerializableString sstr) throws JacksonException

Overrides tools.jackson.core.base.ParserMinimalBase.nextName.

Doc from 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. It is functionally equivalent to:

  return (nextToken() == JsonToken.PROPERTY_NAME) && str.getValue().equals(currentName());
but may be faster for parser to verify, and can therefore be used if caller expects to get such a property name from input next.

Note

in Jackson 2.x method was called nextFieldName()

Annotations
@Override
Exceptions
JacksonException:
for low-level read issues
nextNameMatchback to summary
public int nextNameMatch(PropertyNameMatcher matcher) throws JacksonException

Overrides tools.jackson.core.base.ParserMinimalBase.nextNameMatch.

Doc from 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. If match succeeds, property index (non-negative `int`) is returned; otherwise one of marker constants from PropertyNameMatcher.

Annotations
@Override
nextStringValueback to summary
public abstract String nextStringValue() throws JacksonException

Overrides tools.jackson.core.JsonParser.nextStringValue.

Doc from tools.jackson.core.JsonParser.nextStringValue.

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_STRING returns contained String value; otherwise returns null. It is functionally equivalent to:

  return (nextToken() == JsonToken.VALUE_STRING) ? getString() : null;
but may be faster for parser to process, and can therefore be used if caller expects to get a String value next from input.
Annotations
@Override
nextTokenback to summary
public JsonToken nextToken() throws JacksonException

Implements abstract tools.jackson.core.JsonParser.nextToken.

Doc from tools.jackson.core.JsonParser.nextToken.

Main iteration method, which will advance stream enough to determine type of the next token, if any. If none remaining (stream has no content other than possible white space before ending), null will be returned.

Annotations
@Override
Exceptions
JacksonException:
for low-level read issues
setAvroContextback to summary
public final void setAvroContext(AvroReadContext ctxt)
setBytesback to summary
protected final JsonToken setBytes(byte[] b)
setNumberback to summary
protected final JsonToken setNumber(int v)
setNumberback to summary
protected final JsonToken setNumber(long v)
setNumberback to summary
protected final JsonToken setNumber(float v)
setNumberback to summary
protected final JsonToken setNumber(double v)
setStringback to summary
protected abstract JsonToken setString(String str) throws IOException
skipArrayback to summary
public abstract long skipArray() throws IOException
Returns:long

Either 0, in which case all entries have been successfully skipped; or positive non-zero number to indicate elements that caller has to skip

skipBooleanback to summary
public abstract void skipBoolean() throws IOException
skipBytesback to summary
public abstract void skipBytes() throws IOException
skipBytesDecimalback to summary
public void skipBytesDecimal() throws IOException
skipDoubleback to summary
public abstract void skipDouble() throws IOException
skipFixedback to summary
public abstract void skipFixed(int size) throws IOException
skipFixedDecimalback to summary
public void skipFixedDecimal(int size) throws IOException
skipFloatback to summary
public abstract void skipFloat() throws IOException
skipIntback to summary
public abstract void skipInt() throws IOException
skipLongback to summary
public abstract void skipLong() throws IOException
skipMapback to summary
public abstract long skipMap() throws IOException
Returns:long

Either 0, in which case all entries have been successfully skipped; or positive non-zero number to indicate map entries that caller has to skip

skipStringback to summary
public abstract void skipString() throws IOException
skipValueback to summary
public final void skipValue() throws JacksonException

Skip to the end of the current structure (array/map/object); This is different from skipMap() and skipArray() because it operates at the parser level instead of at the decoder level and advances the parsing context in addition to consuming the data from the input.

Exceptions
JacksonException:
If there was an issue advancing through the underlying data stream