Class SmileParserBase

java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
tools.jackson.dataformat.smile.SmileParserBase
All Implemented Interfaces:
Closeable, AutoCloseable, tools.jackson.core.Versioned
Direct Known Subclasses:
NonBlockingParserBase, SmileParser

public abstract class SmileParserBase extends tools.jackson.core.base.ParserMinimalBase
  • Nested Class Summary

    Nested classes/interfaces inherited from class tools.jackson.core.JsonParser

    tools.jackson.core.JsonParser.NumberType, tools.jackson.core.JsonParser.NumberTypeFP
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected byte[]
    We will hold on to decoded binary data, for duration of current event, so that multiple calls to JsonParser.getBinaryValue(Base64Variant) will not need to decode data more than once.
    protected long
    Number of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer).
    protected int
    Bit flag composed of bits that indicate which SmileReadFeatures are enabled.
    protected int
    Index of character after last available one in the buffer.
    protected int
    Pointer to next available character in buffer
    protected boolean
    Flag that indicates whether content can legally have raw (unquoted) binary data.
    protected BigDecimal
     
    protected BigInteger
     
    protected double
     
    protected float
     
    protected int
     
    protected long
     
    protected tools.jackson.core.JsonParser.NumberType
     
    protected int
    Bitfield that indicates which numeric representations have been calculated for the current type
    protected int
    Quads used for hash calculation
    protected int
    Quads used for hash calculation
    protected int
    Quads used for hash calculation
    protected int[]
    Temporary buffer used for name parsing.
    protected int
     
    protected String[]
    Array of recently seen field names, which may be back referenced by later fields.
    protected int
     
    protected String[]
    Array of recently seen field names, which may be back referenced by later fields Defaults set to disable handling if no header found.
    protected tools.jackson.core.util.SimpleStreamReadContext
    Information about parser context, context in which the next token is to be parsed (root, array, object).
    protected final tools.jackson.core.sym.ByteQuadsCanonicalizer
    Symbol table that contains field names encountered so far
    protected final boolean
    Marker flag to indicate that standard symbol handling is used (one with symbol table assisted canonicalization.
    protected final tools.jackson.core.util.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
    Alternative to _tokenInputTotal that will only contain offset within input buffer, as int.
    protected static final int
     
    protected static final int
     
    protected static final int
     
    protected static final String[]
     
    protected static final tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability>
     

    Fields inherited from class tools.jackson.core.base.ParserMinimalBase

    _closed, _currToken, _ioContext, _lastClearedToken, _objectReadContext, _streamReadConstraints, _streamReadFeatures, _tokenCount, _trackMaxTokenCount, 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_RS, INT_SLASH, INT_SPACE, INT_TAB, MAX_BYTE_I, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MAX_SHORT_I, MIN_BYTE_I, MIN_INT_D, MIN_INT_L, MIN_LONG_D, MIN_SHORT_I, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN, STREAM_READ_FEATURE_DEFAULTS

    Fields inherited from class tools.jackson.core.JsonParser

    DEFAULT_READ_CAPABILITIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    SmileParserBase(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int formatFeatures, tools.jackson.core.sym.ByteQuadsCanonicalizer sym)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
     
    protected void
    Method called when an EOF is encountered between tokens.
    protected abstract void
    Method called to complete parsing of a numeric value: will throw StreamReadException if current token is not numeric.
    protected abstract boolean
    Similar to _parseNumericValue(), but will not throw exception if the current token is not a numeric value.
    protected final void
     
    protected abstract void
     
    protected void
    _reportMismatchedEndMarker(int actCh, char expCh)
     
    protected tools.jackson.core.io.ContentReference
    Helper method used to encapsulate logic of including (or not) of "source reference" when constructing TokenStreamLocation instances.
    void
     
    final void
     
    protected final void
     
    protected final void
     
    protected final void
     
    protected final void
     
    protected final void
     
    protected final void
     
    final tools.jackson.core.TokenStreamLocation
    Overridden since we do not really have character-based locations, but we do have byte offset to specify.
    final String
    Method that can be called to get the name associated with the current event.
    final tools.jackson.core.TokenStreamLocation
    Overridden since we do not really have character-based locations, but we do have byte offset to specify.
     
     
     
    final double
     
    final float
     
    final int
     
    final long
     
    final tools.jackson.core.JsonParser.NumberType
     
    tools.jackson.core.JsonParser.NumberTypeFP
     
    final Number
     
    final Number
     
    final boolean
     
    final boolean
     
    final boolean
     
    tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability>
     
    final tools.jackson.core.util.SimpleStreamReadContext
     
    final tools.jackson.core.Version
     

    Methods inherited from class tools.jackson.core.base.ParserMinimalBase

    _constructInputCoercion, _constructNotNumericType, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _nullSafeUpdateToken, _reportBadInputStream, _reportBadReader, _reportError, _reportError, _reportError, _reportError, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidNumber, _reportInvalidSpace, _reportInvalidUTF8Surrogate, _reportMissingRootWS, _reportOverflowByte, _reportOverflowInt, _reportOverflowInt, _reportOverflowInt, _reportOverflowLong, _reportOverflowLong, _reportOverflowLong, _reportOverflowShort, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _updateToken, _updateTokenToNA, _updateTokenToNull, _wrapIOFailure, clearCurrentToken, currentNameMatch, currentToken, currentTokenCount, currentTokenId, finishToken, getBooleanValue, getByteValue, getEmbeddedObject, getLastClearedToken, getNumberValueDeferred, getShortValue, getString, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasToken, hasTokenId, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextName, nextName, nextNameMatch, nextValue, objectReadContext, readValueAs, readValueAs, readValueAs, readValueAsTree, skipChildren, streamReadConstraints, streamReadFeatures

    Methods inherited from class tools.jackson.core.JsonParser

    _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, canParseAsync, canReadObjectId, canReadTypeId, getBinaryValue, getBinaryValue, getObjectId, getSchema, getString, getStringCharacters, getStringLength, getStringOffset, getText, getTextCharacters, getTextLength, getTextOffset, getTypeId, getValueAsBoolean, getValueAsDouble, hasStringCharacters, nextBooleanValue, nextIntValue, nextLongValue, nextStringValue, nextToken, nonBlockingInputFeeder, readBinaryValue, readBinaryValue, readString, releaseBuffered, releaseBuffered, streamReadInputSource

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NO_STRINGS

      protected static final String[] NO_STRINGS
    • LONGEST_NON_CHUNKED_BINARY

      protected static final int LONGEST_NON_CHUNKED_BINARY
      See Also:
    • DEFAULT_NAME_BUFFER_LENGTH

      protected static final int DEFAULT_NAME_BUFFER_LENGTH
      See Also:
    • DEFAULT_STRING_VALUE_BUFFER_LENGTH

      protected static final int DEFAULT_STRING_VALUE_BUFFER_LENGTH
      See Also:
    • SMILE_READ_CAPABILITIES

      protected static final tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability> SMILE_READ_CAPABILITIES
    • _formatFeatures

      protected int _formatFeatures
      Bit flag composed of bits that indicate which SmileReadFeatures are enabled.

      NOTE: currently the only feature (SmileReadFeature.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.
    • _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.
    • _streamReadContext

      protected tools.jackson.core.util.SimpleStreamReadContext _streamReadContext
      Information about parser context, context in which the next token is to be parsed (root, array, object).
    • _textBuffer

      protected final tools.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)
    • _binaryValue

      protected byte[] _binaryValue
      We will hold on to decoded binary data, for duration of current event, so that multiple calls to JsonParser.getBinaryValue(Base64Variant) will not need to decode data more than once.
    • _numberType

      protected tools.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
    • _numberLong

      protected long _numberLong
    • _numberFloat

      protected float _numberFloat
    • _numberDouble

      protected double _numberDouble
    • _symbols

      protected final tools.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
    • _symbolsCanonical

      protected final boolean _symbolsCanonical
      Marker flag to indicate that standard symbol handling is used (one with symbol table assisted canonicalization. May be disabled in which case alternate stream-line, non-canonicalizing handling is used: usually due to set of symbols (Object property names) is unbounded and will not benefit from canonicalization attempts.
    • _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
  • Constructor Details

    • SmileParserBase

      public SmileParserBase(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int formatFeatures, tools.jackson.core.sym.ByteQuadsCanonicalizer sym)
  • Method Details

    • version

      public final tools.jackson.core.Version version()
      Specified by:
      version in interface tools.jackson.core.Versioned
      Specified by:
      version in class tools.jackson.core.JsonParser
    • streamReadCapabilities

      public tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability> streamReadCapabilities()
      Overrides:
      streamReadCapabilities in class tools.jackson.core.base.ParserMinimalBase
    • mayContainRawBinary

      public final boolean mayContainRawBinary()
    • _closeInput

      protected abstract void _closeInput() throws tools.jackson.core.JacksonException
      Specified by:
      _closeInput in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • _parseNumericValue

      protected abstract void _parseNumericValue() throws tools.jackson.core.JacksonException
      Method called to complete parsing of a numeric value: will throw StreamReadException if current token is not numeric.
      Throws:
      tools.jackson.core.exc.StreamReadException - if current token is not numeric
      tools.jackson.core.JacksonException
    • _parseNumericValueIfNumber

      protected abstract boolean _parseNumericValueIfNumber() throws tools.jackson.core.JacksonException
      Similar to _parseNumericValue(), but will not throw exception if the current token is not a numeric value.
      Returns:
      true if current token is numeric; false otherwise
      Throws:
      tools.jackson.core.JacksonException
    • streamReadContext

      public final tools.jackson.core.util.SimpleStreamReadContext streamReadContext()
      Specified by:
      streamReadContext in class tools.jackson.core.JsonParser
    • assignCurrentValue

      public void assignCurrentValue(Object v)
      Specified by:
      assignCurrentValue in class tools.jackson.core.JsonParser
    • currentValue

      public Object currentValue()
      Specified by:
      currentValue in class tools.jackson.core.JsonParser
    • isClosed

      public final boolean isClosed()
      Overrides:
      isClosed in class tools.jackson.core.base.ParserMinimalBase
    • currentTokenLocation

      public final tools.jackson.core.TokenStreamLocation currentTokenLocation()
      Overridden since we do not really have character-based locations, but we do have byte offset to specify.
      Specified by:
      currentTokenLocation in class tools.jackson.core.JsonParser
    • currentLocation

      public final tools.jackson.core.TokenStreamLocation currentLocation()
      Overridden since we do not really have character-based locations, but we do have byte offset to specify.
      Specified by:
      currentLocation in class tools.jackson.core.JsonParser
    • currentName

      public final String currentName()
      Method that can be called to get the name associated with the current event.
      Specified by:
      currentName in class tools.jackson.core.JsonParser
    • close

      public final void close() throws tools.jackson.core.JacksonException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • _releaseBuffers

      protected final void _releaseBuffers()
      Specified by:
      _releaseBuffers in class tools.jackson.core.base.ParserMinimalBase
    • _releaseBuffers2

      protected abstract void _releaseBuffers2()
    • isNaN

      public final boolean isNaN() throws tools.jackson.core.JacksonException
      Specified by:
      isNaN in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getNumberValue

      public final Number getNumberValue() throws tools.jackson.core.JacksonException
      Specified by:
      getNumberValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getNumberValueExact

      public final Number getNumberValueExact() throws tools.jackson.core.JacksonException
      Overrides:
      getNumberValueExact in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • getNumberType

      public final tools.jackson.core.JsonParser.NumberType getNumberType() throws tools.jackson.core.JacksonException
      Specified by:
      getNumberType in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getNumberTypeFP

      public tools.jackson.core.JsonParser.NumberTypeFP getNumberTypeFP() throws tools.jackson.core.JacksonException
      Overrides:
      getNumberTypeFP in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • getIntValue

      public final int getIntValue() throws tools.jackson.core.JacksonException
      Specified by:
      getIntValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getLongValue

      public final long getLongValue() throws tools.jackson.core.JacksonException
      Specified by:
      getLongValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getBigIntegerValue

      public final BigInteger getBigIntegerValue() throws tools.jackson.core.JacksonException
      Specified by:
      getBigIntegerValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getFloatValue

      public final float getFloatValue() throws tools.jackson.core.JacksonException
      Specified by:
      getFloatValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getDoubleValue

      public final double getDoubleValue() throws tools.jackson.core.JacksonException
      Specified by:
      getDoubleValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getDecimalValue

      public final BigDecimal getDecimalValue() throws tools.jackson.core.JacksonException
      Specified by:
      getDecimalValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • convertNumberToInt

      protected final void convertNumberToInt() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • convertNumberToLong

      protected final void convertNumberToLong() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • convertNumberToBigInteger

      protected final void convertNumberToBigInteger() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • convertNumberToFloat

      protected final void convertNumberToFloat() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • convertNumberToDouble

      protected final void convertNumberToDouble() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • convertNumberToBigDecimal

      protected final void convertNumberToBigDecimal() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _handleEOF

      protected void _handleEOF() throws tools.jackson.core.exc.StreamReadException
      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 tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _reportMismatchedEndMarker

      protected void _reportMismatchedEndMarker(int actCh, char expCh) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _sourceReference

      protected tools.jackson.core.io.ContentReference _sourceReference()
      Helper method used to encapsulate logic of including (or not) of "source reference" when constructing TokenStreamLocation instances.