com.fasterxml.jackson.dataformat.smile

## Class SmileParserBase

- java.lang.Object
- - com.fasterxml.jackson.core.JsonParser
  - - com.fasterxml.jackson.core.base.ParserMinimalBase
    - - com.fasterxml.jackson.dataformat.smile.SmileParserBase

- All Implemented Interfaces:
    com.fasterxml.jackson.core.Versioned, Closeable, AutoCloseable
  Direct Known Subclasses:
    NonBlockingParserBase, SmileParser

      public abstract class SmileParserBase
      extends com.fasterxml.jackson.core.base.ParserMinimalBase

  Since:
    2.9

- - ### Nested Class Summary

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

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

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected byte[]` | `_binaryValue` We will hold on to decoded binary data, for duration of current event, so that multiple calls to `ParserMinimalBase.getBinaryValue(com.fasterxml.jackson.core.Base64Variant)` will not need to decode data more than once.
    `protected boolean` | `_closed` Flag that indicates whether parser is closed or not.
    `protected long` | `_currInputProcessed` Number of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer).
    `protected int` | `_formatFeatures` Bit flag composed of bits that indicate which `SmileParser.Feature`s are enabled.
    `protected int` | `_inputEnd` Index of character after last available one in the buffer.
    `protected int` | `_inputPtr` Pointer to next available character in buffer
    `protected com.fasterxml.jackson.core.io.IOContext` | `_ioContext` I/O context for this reader.
    `protected boolean` | `_mayContainRawBinary` Flag that indicates whether content can legally have raw (unquoted) binary data.
    `protected boolean` | `_nameCopied` 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)
    `protected char[]` | `_nameCopyBuffer` Temporary buffer that is needed if field name is accessed using `ParserMinimalBase.getTextCharacters()` method (instead of String returning alternatives)
    `protected BigDecimal` | `_numberBigDecimal`
    `protected BigInteger` | `_numberBigInt`
    `protected double` | `_numberDouble`
    `protected float` | `_numberFloat`
    `protected int` | `_numberInt`
    `protected long` | `_numberLong`
    `protected com.fasterxml.jackson.core.JsonParser.NumberType` | `_numberType`
    `protected int` | `_numTypesValid` Bitfield that indicates which numeric representations have been calculated for the current type
    `protected com.fasterxml.jackson.core.json.JsonReadContext` | `_parsingContext` Information about parser context, context in which the next token is to be parsed (root, array, object).
    `protected int` | `_quad1` Quads used for hash calculation
    `protected int` | `_quad2` Quads used for hash calculation
    `protected int` | `_quad3` Quads used for hash calculation
    `protected int[]` | `_quadBuffer` Temporary buffer used for name parsing.
    `protected int` | `_seenNameCount`
    `protected String[]` | `_seenNames` Array of recently seen field names, which may be back referenced by later fields.
    `protected int` | `_seenStringValueCount`
    `protected String[]` | `_seenStringValues` Array of recently seen field names, which may be back referenced by later fields Defaults set to disable handling if no header found.
    `protected SmileBufferRecycler<String>` | `_smileBufferRecycler` Helper object used for low-level recycling of Smile-generator specific buffers.
    `protected static ThreadLocal<SoftReference<SmileBufferRecycler<String>>>` | `_smileRecyclerRef` `ThreadLocal` contains a `SoftReference` to a buffer recycler used to provide a low-cost buffer recycling for Smile-specific buffers.
    `protected com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer` | `_symbols` Symbol table that contains field names encountered so far
    `protected com.fasterxml.jackson.core.util.TextBuffer` | `_textBuffer` 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)
    `protected int` | `_tokenOffsetForTotal` Alternative to `#_tokenInputTotal` that will only contain offset within input buffer, as int.
    `protected static String[]` | `NO_STRINGS`

    - ### 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
    `SmileParserBase(com.fasterxml.jackson.core.io.IOContext ctxt, int parserFeatures, int formatFeatures, com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer sym)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract void` | `_closeInput()`
    `protected Object` | `_getSourceReference()` Helper method used to encapsulate logic of including (or not) of "source reference" when constructing `JsonLocation` instances.
    `protected void` | `_handleEOF()` Method called when an EOF is encountered between tokens.
    `protected abstract void` | `_parseNumericValue()`
    `protected void` | `_releaseBuffers()`
    `protected abstract void` | `_releaseBuffers2()`
    `protected void` | `_reportMismatchedEndMarker(int actCh, char expCh)`
    `protected static SmileBufferRecycler<String>` | `_smileBufferRecycler()`
    `void` | `close()`
    `protected void` | `convertNumberToBigDecimal()`
    `protected void` | `convertNumberToBigInteger()`
    `protected void` | `convertNumberToDouble()`
    `protected void` | `convertNumberToFloat()`
    `protected void` | `convertNumberToInt()`
    `protected void` | `convertNumberToLong()`
    `BigInteger` | `getBigIntegerValue()`
    `com.fasterxml.jackson.core.JsonLocation` | `getCurrentLocation()` Overridden since we do not really have character-based locations, but we do have byte offset to specify.
    `String` | `getCurrentName()` Method that can be called to get the name associated with the current event.
    `BigDecimal` | `getDecimalValue()`
    `double` | `getDoubleValue()`
    `float` | `getFloatValue()`
    `int` | `getFormatFeatures()`
    `int` | `getIntValue()`
    `long` | `getLongValue()`
    `com.fasterxml.jackson.core.JsonParser.NumberType` | `getNumberType()`
    `Number` | `getNumberValue()`
    `com.fasterxml.jackson.core.json.JsonReadContext` | `getParsingContext()`
    `com.fasterxml.jackson.core.JsonLocation` | `getTokenLocation()` Overridden since we do not really have character-based locations, but we do have byte offset to specify.
    `boolean` | `isClosed()`
    `boolean` | `isNaN()`
    `boolean` | `mayContainRawBinary()`
    `void` | `overrideCurrentName(String name)`
    `com.fasterxml.jackson.core.JsonParser` | `overrideFormatFeatures(int values, int mask)`
    `com.fasterxml.jackson.core.Version` | `version()`

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

      `_ascii, _asciiBytes, _constructError, _decodeBase64, _getCharDesc, _handleUnrecognizedCharacterEscape, _hasTextualNull, _reportError, _reportError, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidEOFInValue, _reportMissingRootWS, _reportUnexpectedChar, _throwInternal, _throwInvalidSpace, _throwUnquotedSpace, _wrapError, clearCurrentToken, currentToken, currentTokenId, getBinaryValue, getCurrentToken, getCurrentTokenId, getLastClearedToken, getText, getTextCharacters, getTextLength, getTextOffset, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasTextCharacters, hasToken, hasTokenId, isExpectedStartArrayToken, isExpectedStartObjectToken, nextToken, nextValue, reportInvalidNumber, reportOverflowInt, reportOverflowLong, reportUnexpectedNumberChar, skipChildren`

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

      `_codec, _constructError, _reportUnsupportedOperation, canParseAsync, canReadObjectId, canReadTypeId, canUseSchema, configure, disable, enable, finishToken, getBinaryValue, getBooleanValue, getByteValue, getCodec, getCurrentValue, getEmbeddedObject, getFeatureMask, getInputSource, getNonBlockingInputFeeder, getObjectId, getSchema, getShortValue, getText, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, overrideStdFeatures, readBinaryValue, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, releaseBuffered, requiresCustomCodec, setCodec, setCurrentValue, setFeatureMask, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchema`

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

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

- - ### Field Detail

    - #### NO_STRINGS

          protected static final String[] NO_STRINGS

    - #### _formatFeatures

          protected int _formatFeatures

      Bit flag composed of bits that indicate which `SmileParser.Feature`s are enabled.

      NOTE: currently the only feature (`SmileParser.Feature.REQUIRE_HEADER` takes effect during bootstrapping.

    - #### _mayContainRawBinary

          protected boolean _mayContainRawBinary

      Flag that indicates whether content can legally have raw (unquoted) binary data. Since this information is included both in header and in actual binary data blocks there is redundancy, and we want to ensure settings are compliant. Using application may also want to know this setting in case it does some direct (random) access.

    - #### _ioContext

          protected final com.fasterxml.jackson.core.io.IOContext _ioContext

      I/O context for this reader. It handles buffer allocation for the reader.

    - #### _closed

          protected boolean _closed

      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.

    - #### _inputPtr

          protected int _inputPtr

      Pointer to next available character in buffer

    - #### _inputEnd

          protected int _inputEnd

      Index of character after last available one in the buffer.

    - #### _currInputProcessed

          protected long _currInputProcessed

      Number of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer).

    - #### _tokenOffsetForTotal

          protected int _tokenOffsetForTotal

      Alternative to `#_tokenInputTotal` that will only contain offset within input buffer, as int.

    - #### _parsingContext

          protected com.fasterxml.jackson.core.json.JsonReadContext _parsingContext

      Information about parser context, context in which the next token is to be parsed (root, array, object).

    - #### _textBuffer

          protected final com.fasterxml.jackson.core.util.TextBuffer _textBuffer

      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)

    - #### _nameCopyBuffer

          protected char[] _nameCopyBuffer

      Temporary buffer that is needed if field name is accessed using `ParserMinimalBase.getTextCharacters()` method (instead of String returning alternatives)

    - #### _nameCopied

          protected boolean _nameCopied

      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)

    - #### _binaryValue

          protected byte[] _binaryValue

      We will hold on to decoded binary data, for duration of current event, so that multiple calls to `ParserMinimalBase.getBinaryValue(com.fasterxml.jackson.core.Base64Variant)` will not need to decode data more than once.

    - #### _numberType

          protected com.fasterxml.jackson.core.JsonParser.NumberType _numberType

    - #### _numTypesValid

          protected int _numTypesValid

      Bitfield that indicates which numeric representations have been calculated for the current type

    - #### _numberBigInt

          protected BigInteger _numberBigInt

    - #### _numberBigDecimal

          protected BigDecimal _numberBigDecimal

    - #### _numberInt

          protected int _numberInt

    - #### _numberFloat

          protected float _numberFloat

    - #### _numberLong

          protected long _numberLong

    - #### _numberDouble

          protected double _numberDouble

    - #### _symbols

          protected final com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer _symbols

      Symbol table that contains field names encountered so far

    - #### _quadBuffer

          protected int[] _quadBuffer

      Temporary buffer used for name parsing.

    - #### _quad1

          protected int _quad1

      Quads used for hash calculation

    - #### _quad2

          protected int _quad2

      Quads used for hash calculation

    - #### _quad3

          protected int _quad3

      Quads used for hash calculation

    - #### _seenNames

          protected String[] _seenNames

      Array of recently seen field names, which may be back referenced by later fields. Defaults set to enable handling even if no header found.

    - #### _seenNameCount

          protected int _seenNameCount

    - #### _seenStringValues

          protected String[] _seenStringValues

      Array of recently seen field names, which may be back referenced by later fields Defaults set to disable handling if no header found.

    - #### _seenStringValueCount

          protected int _seenStringValueCount

    - #### _smileRecyclerRef

          protected static final ThreadLocal<SoftReference<SmileBufferRecycler<String>>> _smileRecyclerRef

      `ThreadLocal` contains a `SoftReference` to a buffer recycler used to provide a low-cost buffer recycling for Smile-specific buffers.

    - #### _smileBufferRecycler

          protected final SmileBufferRecycler<String> _smileBufferRecycler

      Helper object used for low-level recycling of Smile-generator specific buffers.

  - ### Constructor Detail

    - #### SmileParserBase

          public SmileParserBase(com.fasterxml.jackson.core.io.IOContext ctxt,
                         int parserFeatures,
                         int formatFeatures,
                         com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer sym)

  - ### Method Detail

    - #### _smileBufferRecycler

          protected static final SmileBufferRecycler<String> _smileBufferRecycler()

    - #### version

          public final com.fasterxml.jackson.core.Version version()

      Specified by:
        `version` in interface `com.fasterxml.jackson.core.Versioned`
      Specified by:
        `version` in class `com.fasterxml.jackson.core.JsonParser`

    - #### mayContainRawBinary

          public final boolean mayContainRawBinary()

    - #### getFormatFeatures

          public final int getFormatFeatures()

      Overrides:
        `getFormatFeatures` in class `com.fasterxml.jackson.core.JsonParser`

    - #### overrideFormatFeatures

          public final com.fasterxml.jackson.core.JsonParser overrideFormatFeatures(int values,
                                                                     int mask)

      Overrides:
        `overrideFormatFeatures` in class `com.fasterxml.jackson.core.JsonParser`

    - #### _closeInput

          protected abstract void _closeInput()
                                       throws IOException

      Throws:
        `IOException`

    - #### _parseNumericValue

          protected abstract void _parseNumericValue()
                                              throws IOException

      Throws:
        `IOException`

    - #### getTokenLocation

          public final com.fasterxml.jackson.core.JsonLocation getTokenLocation()

      Overridden since we do not really have character-based locations, but we do have byte offset to specify.
      Specified by:
        `getTokenLocation` in class `com.fasterxml.jackson.core.JsonParser`

    - #### getCurrentLocation

          public final com.fasterxml.jackson.core.JsonLocation getCurrentLocation()

      Overridden since we do not really have character-based locations, but we do have byte offset to specify.
      Specified by:
        `getCurrentLocation` in class `com.fasterxml.jackson.core.JsonParser`

    - #### getCurrentName

          public final String getCurrentName()
                                      throws IOException

      Method that can be called to get the name associated with the current event.
      Specified by:
        `getCurrentName` in class `com.fasterxml.jackson.core.base.ParserMinimalBase`
      Throws:
        `IOException`

    - #### overrideCurrentName

          public final void overrideCurrentName(String name)

      Specified by:
        `overrideCurrentName` in class `com.fasterxml.jackson.core.base.ParserMinimalBase`

    - #### close

          public final void close()
                           throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `com.fasterxml.jackson.core.base.ParserMinimalBase`
      Throws:
        `IOException`

    - #### _releaseBuffers

          protected final void _releaseBuffers()
                                        throws IOException

      Throws:
        `IOException`

    - #### _releaseBuffers2

          protected abstract void _releaseBuffers2()

    - #### isClosed

          public final boolean isClosed()

      Specified by:
        `isClosed` in class `com.fasterxml.jackson.core.base.ParserMinimalBase`

    - #### getParsingContext

          public final com.fasterxml.jackson.core.json.JsonReadContext getParsingContext()

      Specified by:
        `getParsingContext` in class `com.fasterxml.jackson.core.base.ParserMinimalBase`

    - #### isNaN

          public final boolean isNaN()
                              throws IOException

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

    - #### getNumberValue

          public final Number getNumberValue()
                                      throws IOException

      Specified by:
        `getNumberValue` in class `com.fasterxml.jackson.core.JsonParser`
      Throws:
        `IOException`

    - #### getNumberType

          public final com.fasterxml.jackson.core.JsonParser.NumberType getNumberType()
                                                                               throws IOException

      Specified by:
        `getNumberType` in class `com.fasterxml.jackson.core.JsonParser`
      Throws:
        `IOException`

    - #### getIntValue

          public final int getIntValue()
                                throws IOException

      Specified by:
        `getIntValue` in class `com.fasterxml.jackson.core.JsonParser`
      Throws:
        `IOException`

    - #### getLongValue

          public final long getLongValue()
                                  throws IOException

      Specified by:
        `getLongValue` in class `com.fasterxml.jackson.core.JsonParser`
      Throws:
        `IOException`

    - #### getBigIntegerValue

          public final BigInteger getBigIntegerValue()
                                              throws IOException

      Specified by:
        `getBigIntegerValue` in class `com.fasterxml.jackson.core.JsonParser`
      Throws:
        `IOException`

    - #### getFloatValue

          public final float getFloatValue()
                                    throws IOException

      Specified by:
        `getFloatValue` in class `com.fasterxml.jackson.core.JsonParser`
      Throws:
        `IOException`

    - #### getDoubleValue

          public final double getDoubleValue()
                                      throws IOException

      Specified by:
        `getDoubleValue` in class `com.fasterxml.jackson.core.JsonParser`
      Throws:
        `IOException`

    - #### getDecimalValue

          public final BigDecimal getDecimalValue()
                                           throws IOException

      Specified by:
        `getDecimalValue` in class `com.fasterxml.jackson.core.JsonParser`
      Throws:
        `IOException`

    - #### convertNumberToInt

          protected final void convertNumberToInt()
                                           throws IOException

      Throws:
        `IOException`

    - #### convertNumberToLong

          protected final void convertNumberToLong()
                                            throws IOException

      Throws:
        `IOException`

    - #### convertNumberToBigInteger

          protected final void convertNumberToBigInteger()
                                                  throws IOException

      Throws:
        `IOException`

    - #### convertNumberToFloat

          protected final void convertNumberToFloat()
                                             throws IOException

      Throws:
        `IOException`

    - #### convertNumberToDouble

          protected final void convertNumberToDouble()
                                              throws IOException

      Throws:
        `IOException`

    - #### convertNumberToBigDecimal

          protected final void convertNumberToBigDecimal()
                                                  throws IOException

      Throws:
        `IOException`

    - #### _handleEOF

          protected void _handleEOF()
                             throws com.fasterxml.jackson.core.JsonParseException

      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.
      Specified by:
        `_handleEOF` in class `com.fasterxml.jackson.core.base.ParserMinimalBase`
      Throws:
        `com.fasterxml.jackson.core.JsonParseException`

    - #### _reportMismatchedEndMarker

          protected void _reportMismatchedEndMarker(int actCh,
                                        char expCh)
                                             throws com.fasterxml.jackson.core.JsonParseException

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

    - #### _getSourceReference

          protected Object _getSourceReference()

      Helper method used to encapsulate logic of including (or not) of "source reference" when constructing `JsonLocation` instances.
      Since:
        2.9

Copyright © 2017 FasterXML. All rights reserved.