com.fasterxml.jackson.dataformat.avro.deser

## Class JacksonAvroParserImpl

- java.lang.Object
- - com.fasterxml.jackson.core.JsonParser
  - - com.fasterxml.jackson.core.base.ParserMinimalBase
    - - com.fasterxml.jackson.core.base.ParserBase
      - - com.fasterxml.jackson.dataformat.avro.AvroParser
        - - com.fasterxml.jackson.dataformat.avro.deser.AvroParserImpl
          - - com.fasterxml.jackson.dataformat.avro.deser.JacksonAvroParserImpl

- All Implemented Interfaces:
    com.fasterxml.jackson.core.Versioned, Closeable, AutoCloseable

      public class JacksonAvroParserImpl
      extends AvroParserImpl

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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.fasterxml.jackson.dataformat.avro.AvroParser

      `AvroParser.Feature`

    - ### Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonParser

      `com.fasterxml.jackson.core.JsonParser.NumberType`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `_bufferRecyclable` Flag that indicates whether the input buffer is recycable (and needs to be returned to recycler once we are done) or not.
    `protected byte[]` | `_inputBuffer` Current buffer from which data is read; generally data is read into buffer from input source, but in some cases pre-loaded buffer is handed to the parser.
    `protected InputStream` | `_inputStream`
    `static int[]` | `sUtf8UnitLengths` Additionally we can combine UTF-8 decoding info into similar data table.

    - ### Fields inherited from class com.fasterxml.jackson.dataformat.avro.deser.AvroParserImpl

      `_branchIndex, _enumIndex, _numberFloat`

    - ### Fields inherited from class com.fasterxml.jackson.dataformat.avro.AvroParser

      `_avroContext, _formatFeatures, _objectCodec, _rootSchema`

    - ### Fields inherited from class com.fasterxml.jackson.core.base.ParserBase

      `_binaryValue, _byteArrayBuilder, _closed, _currInputProcessed, _currInputRow, _currInputRowStart, _expLength, _fractLength, _inputEnd, _inputPtr, _intLength, _ioContext, _nameCopied, _nameCopyBuffer, _nextToken, _numberBigDecimal, _numberBigInt, _numberDouble, _numberInt, _numberLong, _numberNegative, _numTypesValid, _parsingContext, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotal`

    - ### Fields inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase

      `_currToken, _lastClearedToken, BD_MAX_INT, BD_MAX_LONG, BD_MIN_INT, BD_MIN_LONG, BI_MAX_INT, BI_MAX_LONG, BI_MIN_INT, BI_MIN_LONG, CHAR_NULL, INT_0, INT_9, INT_APOS, INT_ASTERISK, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_e, INT_E, INT_HASH, INT_LBRACKET, INT_LCURLY, INT_LF, INT_MINUS, INT_PERIOD, INT_PLUS, INT_QUOTE, INT_RBRACKET, INT_RCURLY, INT_SLASH, INT_SPACE, INT_TAB, MAX_ERROR_TOKEN_LENGTH, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MIN_INT_D, MIN_INT_L, MIN_LONG_D, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN`

    - ### Fields inherited from class com.fasterxml.jackson.core.JsonParser

      `_features, _requestPayload`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JacksonAvroParserImpl(com.fasterxml.jackson.core.io.IOContext ctxt, int parserFeatures, int avroFeatures, com.fasterxml.jackson.core.ObjectCodec codec, byte[] data, int offset, int len)`
    `JacksonAvroParserImpl(com.fasterxml.jackson.core.io.IOContext ctxt, int parserFeatures, int avroFeatures, com.fasterxml.jackson.core.ObjectCodec codec, InputStream in)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `_closeInput()`
    `int` | `_decodeIntSlow()`
    `long` | `_decodeLongSlow()`
    `protected boolean` | `_loadMore()`
    `protected void` | `_loadMoreGuaranteed()`
    `protected void` | `_loadToHaveAtLeast(int minAvailable)` Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessary
    `protected void` | `_releaseBuffers()`
    `protected void` | `_reportInvalidChar(int c)`
    `void` | `_skipIntSlow()`
    `void` | `_skipLongSlow()`
    `boolean` | `checkInputEnd()`
    `long` | `decodeArrayNext()`
    `long` | `decodeArrayStart()`
    `com.fasterxml.jackson.core.JsonToken` | `decodeBoolean()`
    `com.fasterxml.jackson.core.JsonToken` | `decodeBytes()`
    `com.fasterxml.jackson.core.JsonToken` | `decodeDouble()`
    `int` | `decodeEnum()`
    `com.fasterxml.jackson.core.JsonToken` | `decodeFixed(int size)`
    `com.fasterxml.jackson.core.JsonToken` | `decodeFloat()`
    `int` | `decodeIndex()`
    `int` | `decodeInt()`
    `com.fasterxml.jackson.core.JsonToken` | `decodeIntToken()`
    `long` | `decodeLong()`
    `com.fasterxml.jackson.core.JsonToken` | `decodeLongToken()`
    `String` | `decodeMapKey()`
    `long` | `decodeMapNext()`
    `long` | `decodeMapStart()`
    `void` | `decodeString()`
    `com.fasterxml.jackson.core.JsonToken` | `decodeStringToken()`
    `Object` | `getInputSource()`
    `String` | `getText()`
    `int` | `getText(Writer writer)`
    `boolean` | `hasTextCharacters()`
    `String` | `nextTextValue()`
    `int` | `releaseBuffered(OutputStream out)`
    `protected com.fasterxml.jackson.core.JsonToken` | `setString(String str)`
    `long` | `skipArray()`
    `void` | `skipBoolean()`
    `void` | `skipBytes()`
    `void` | `skipDouble()`
    `void` | `skipFixed(int size)`
    `void` | `skipFloat()`
    `void` | `skipInt()`
    `void` | `skipLong()`
    `long` | `skipMap()`
    `void` | `skipString()`

    - ### Methods inherited from class com.fasterxml.jackson.dataformat.avro.deser.AvroParserImpl

      `_checkNumericValue, _initSchema, branchIndex, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToFloat, convertNumberToInt, convertNumberToLong, enumIndex, getFloatValue, getNumberType, getNumberValue, getRemainingElements, isNaN, isRecord, nextFieldName, nextFieldName, nextToken, overrideFormatFeatures, setAvroContext, setBytes, setNumber, setNumber, setNumber, setNumber, skipValue`

    - ### Methods inherited from class com.fasterxml.jackson.dataformat.avro.AvroParser

      `_finishString, canReadTypeId, canUseSchema, configure, disable, enable, getBinaryValue, getCodec, getCurrentLocation, getCurrentName, getEmbeddedObject, getSchema, getTextCharacters, getTextLength, getTextOffset, getTokenLocation, getTypeId, isEnabled, overrideCurrentName, setCodec, setSchema, version`

    - ### Methods inherited from class com.fasterxml.jackson.core.base.ParserBase

      `_checkStdFeatureChanges, _decodeBase64Escape, _decodeBase64Escape, _decodeEscaped, _eofAsNextChar, _getByteArrayBuilder, _getSourceReference, _handleBase64MissingPadding, _handleEOF, _handleUnrecognizedCharacterEscape, _parseIntValue, _parseNumericValue, _reportMismatchedEndMarker, _reportTooLongIntegral, _throwUnquotedSpace, _validJsonTokenList, _validJsonValueList, disable, enable, getBigIntegerValue, getCurrentValue, getDecimalValue, getDoubleValue, getIntValue, getLongValue, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, growArrayBy, isClosed, loadMore, loadMoreGuaranteed, overrideStdFeatures, reportInvalidBase64Char, reportInvalidBase64Char, reset, resetAsNaN, resetFloat, resetInt, setCurrentValue, setFeatureMask`

    - ### Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase

      `_ascii, _asciiBytes, _constructError, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidEOFInValue, _reportMissingRootWS, _reportUnexpectedChar, _throwInternal, _throwInvalidSpace, _wrapError, clearCurrentToken, currentToken, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isExpectedStartArrayToken, isExpectedStartObjectToken, nextValue, reportInvalidNumber, reportOverflowInt, reportOverflowInt, reportOverflowInt, reportOverflowLong, reportOverflowLong, reportOverflowLong, reportUnexpectedNumberChar, skipChildren`

    - ### Methods inherited from class com.fasterxml.jackson.core.JsonParser

      `_codec, _constructError, _reportUnsupportedOperation, canParseAsync, canReadObjectId, configure, currentName, finishToken, getBinaryValue, getBooleanValue, getByteValue, getFeatureMask, getFormatFeatures, getNonBlockingInputFeeder, getObjectId, getShortValue, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextIntValue, nextLongValue, readBinaryValue, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, requiresCustomCodec, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### sUtf8UnitLengths

          public static final int[] sUtf8UnitLengths

      Additionally we can combine UTF-8 decoding info into similar data table. Values indicate "byte length - 1"; meaning -1 is used for invalid bytes, 0 for single-byte codes, 1 for 2-byte codes and 2 for 3-byte codes.

    - #### _inputStream

          protected InputStream _inputStream

    - #### _inputBuffer

          protected byte[] _inputBuffer

      Current buffer from which data is read; generally data is read into buffer from input source, but in some cases pre-loaded buffer is handed to the parser.

    - #### _bufferRecyclable

          protected boolean _bufferRecyclable

      Flag that indicates whether the input buffer is recycable (and needs to be returned to recycler once we are done) or not.

      If it is not, it also means that parser can NOT modify underlying buffer.

  - ### Constructor Detail

    - #### JacksonAvroParserImpl

          public JacksonAvroParserImpl(com.fasterxml.jackson.core.io.IOContext ctxt,
                                       int parserFeatures,
                                       int avroFeatures,
                                       com.fasterxml.jackson.core.ObjectCodec codec,
                                       InputStream in)

    - #### JacksonAvroParserImpl

          public JacksonAvroParserImpl(com.fasterxml.jackson.core.io.IOContext ctxt,
                                       int parserFeatures,
                                       int avroFeatures,
                                       com.fasterxml.jackson.core.ObjectCodec codec,
                                       byte[] data,
                                       int offset,
                                       int len)

  - ### Method Detail

    - #### _releaseBuffers

          protected void _releaseBuffers()
                                  throws IOException

      Overrides:
        `_releaseBuffers` in class `com.fasterxml.jackson.core.base.ParserBase`
      Throws:
        `IOException`

    - #### getInputSource

          public Object getInputSource()

      Specified by:
        `getInputSource` in class `AvroParser`

    - #### _closeInput

          protected void _closeInput()
                              throws IOException

      Specified by:
        `_closeInput` in class `AvroParser`
      Throws:
        `IOException`

    - #### releaseBuffered

          public int releaseBuffered(OutputStream out)
                              throws IOException

      Overrides:
        `releaseBuffered` in class `com.fasterxml.jackson.core.JsonParser`
      Throws:
        `IOException`

    - #### nextTextValue

          public String nextTextValue()
                               throws IOException

      Specified by:
        `nextTextValue` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### hasTextCharacters

          public boolean hasTextCharacters()

      Specified by:
        `hasTextCharacters` in class `AvroParser`

    - #### getText

          public String getText()
                         throws IOException

      Specified by:
        `getText` in class `AvroParser`
      Throws:
        `IOException`

    - #### getText

          public int getText(Writer writer)
                      throws IOException

      Specified by:
        `getText` in class `AvroParser`
      Throws:
        `IOException`

    - #### decodeIntToken

          public com.fasterxml.jackson.core.JsonToken decodeIntToken()
                                                              throws IOException

      Specified by:
        `decodeIntToken` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeInt

          public final int decodeInt()
                              throws IOException

      Specified by:
        `decodeInt` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### _decodeIntSlow

          public int _decodeIntSlow()
                             throws IOException

      Throws:
        `IOException`

    - #### skipInt

          public void skipInt()
                       throws IOException

      Specified by:
        `skipInt` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### _skipIntSlow

          public void _skipIntSlow()
                            throws IOException

      Throws:
        `IOException`

    - #### decodeLongToken

          public com.fasterxml.jackson.core.JsonToken decodeLongToken()
                                                               throws IOException

      Specified by:
        `decodeLongToken` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeLong

          public long decodeLong()
                          throws IOException

      Specified by:
        `decodeLong` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### _decodeLongSlow

          public long _decodeLongSlow()
                               throws IOException

      Throws:
        `IOException`

    - #### skipLong

          public void skipLong()
                        throws IOException

      Specified by:
        `skipLong` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### _skipLongSlow

          public void _skipLongSlow()
                             throws IOException

      Throws:
        `IOException`

    - #### decodeFloat

          public com.fasterxml.jackson.core.JsonToken decodeFloat()
                                                           throws IOException

      Specified by:
        `decodeFloat` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### skipFloat

          public void skipFloat()
                         throws IOException

      Specified by:
        `skipFloat` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeDouble

          public com.fasterxml.jackson.core.JsonToken decodeDouble()
                                                            throws IOException

      Specified by:
        `decodeDouble` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### skipDouble

          public void skipDouble()
                          throws IOException

      Specified by:
        `skipDouble` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeStringToken

          public com.fasterxml.jackson.core.JsonToken decodeStringToken()
                                                                 throws IOException

      Specified by:
        `decodeStringToken` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeString

          public void decodeString()
                            throws IOException

      Specified by:
        `decodeString` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### skipString

          public void skipString()
                          throws IOException

      Specified by:
        `skipString` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### _reportInvalidChar

          protected void _reportInvalidChar(int c)
                                     throws com.fasterxml.jackson.core.JsonParseException

      Throws:
        `com.fasterxml.jackson.core.JsonParseException`

    - #### decodeBytes

          public com.fasterxml.jackson.core.JsonToken decodeBytes()
                                                           throws IOException

      Specified by:
        `decodeBytes` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### skipBytes

          public void skipBytes()
                         throws IOException

      Specified by:
        `skipBytes` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeFixed

          public com.fasterxml.jackson.core.JsonToken decodeFixed(int size)
                                                           throws IOException

      Specified by:
        `decodeFixed` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### skipFixed

          public void skipFixed(int size)
                         throws IOException

      Specified by:
        `skipFixed` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeArrayStart

          public long decodeArrayStart()
                                throws IOException

      Specified by:
        `decodeArrayStart` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeArrayNext

          public long decodeArrayNext()
                               throws IOException

      Specified by:
        `decodeArrayNext` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### skipArray

          public long skipArray()
                         throws IOException

      Specified by:
        `skipArray` in class `AvroParserImpl`
      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
      Throws:
        `IOException`

    - #### decodeMapKey

          public String decodeMapKey()
                              throws IOException

      Specified by:
        `decodeMapKey` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeMapStart

          public long decodeMapStart()
                              throws IOException

      Specified by:
        `decodeMapStart` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeMapNext

          public long decodeMapNext()
                             throws IOException

      Specified by:
        `decodeMapNext` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### skipMap

          public long skipMap()
                       throws IOException

      Specified by:
        `skipMap` in class `AvroParserImpl`
      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
      Throws:
        `IOException`

    - #### decodeBoolean

          public com.fasterxml.jackson.core.JsonToken decodeBoolean()
                                                             throws IOException

      Specified by:
        `decodeBoolean` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### skipBoolean

          public void skipBoolean()
                           throws IOException

      Specified by:
        `skipBoolean` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeIndex

          public int decodeIndex()
                          throws IOException

      Specified by:
        `decodeIndex` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### decodeEnum

          public int decodeEnum()
                         throws IOException

      Specified by:
        `decodeEnum` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### checkInputEnd

          public boolean checkInputEnd()
                                throws IOException

      Specified by:
        `checkInputEnd` in class `AvroParserImpl`
      Throws:
        `IOException`

    - #### setString

          protected com.fasterxml.jackson.core.JsonToken setString(String str)

      Specified by:
        `setString` in class `AvroParserImpl`

    - #### _loadMoreGuaranteed

          protected final void _loadMoreGuaranteed()
                                            throws IOException

      Throws:
        `IOException`

    - #### _loadMore

          protected final boolean _loadMore()
                                     throws IOException

      Throws:
        `IOException`

    - #### _loadToHaveAtLeast

          protected final void _loadToHaveAtLeast(int minAvailable)
                                           throws IOException

      Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessary
      Throws:
        `IOException`

Copyright © 2019 FasterXML. All rights reserved.