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

public class SmileParser extends SmileParserBase
  • Field Details

    • _inputStream

      protected InputStream _inputStream
      Input stream that can be used for reading more content, if one in use. May be null, if input comes just as a full buffer, or if the stream has been closed.
    • _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.

    • _typeAsInt

      protected int _typeAsInt
      Type byte of the current token (as in)
    • _tokenIncomplete

      protected boolean _tokenIncomplete
      Flag that indicates that the current token has not yet been fully processed, and needs to be finished for some access (or skipped to obtain the next token)
  • Constructor Details

    • SmileParser

      public SmileParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ctxt, int parserFeatures, int smileFeatures, tools.jackson.core.sym.ByteQuadsCanonicalizer sym, InputStream in, byte[] inputBuffer, int start, int end, boolean bufferRecyclable)
  • Method Details

    • handleSignature

      protected boolean handleSignature(boolean consumeFirstByte, boolean throwException) throws tools.jackson.core.JacksonException
      Helper method called when it looks like input might contain the signature; and it is necessary to detect and handle signature to get configuration information it might have.
      Returns:
      True if valid signature was found and handled; false if not
      Throws:
      tools.jackson.core.JacksonException
    • releaseBuffered

      public int releaseBuffered(OutputStream out) throws tools.jackson.core.JacksonException
      Overrides:
      releaseBuffered in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • streamReadInputSource

      public Object streamReadInputSource()
      Specified by:
      streamReadInputSource in class tools.jackson.core.JsonParser
    • _loadMoreGuaranteed

      protected final void _loadMoreGuaranteed() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _loadMore

      protected final boolean _loadMore() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _loadToHaveAtLeast

      protected final void _loadToHaveAtLeast(int minAvailable) throws tools.jackson.core.JacksonException
      Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessary. Exception throws if not enough content can be read.
      Parameters:
      minAvailable - Minimum number of bytes we absolutely need
      Throws:
      tools.jackson.core.JacksonException - if read failed, either due to I/O issue or because not enough content could be read before end-of-input.
    • _tryToLoadToHaveAtLeast

      protected final int _tryToLoadToHaveAtLeast(int minAvailable) throws tools.jackson.core.JacksonException
      Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessary.
      Returns:
      Number of bytes that were missing, if any; 0 for successful read
      Throws:
      tools.jackson.core.JacksonException
    • _closeInput

      protected void _closeInput()
      Specified by:
      _closeInput in class SmileParserBase
    • hasStringCharacters

      public boolean hasStringCharacters()
      Specified by:
      hasStringCharacters in class tools.jackson.core.JsonParser
    • _releaseBuffers2

      protected void _releaseBuffers2()
      Method called to release internal buffers owned by the base reader. This may be called along with _closeInput() (for example, when explicitly closing this reader instance), or separately (if need be).
      Specified by:
      _releaseBuffers2 in class SmileParserBase
    • nextToken

      public tools.jackson.core.JsonToken nextToken() throws tools.jackson.core.JacksonException
      Specified by:
      nextToken in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • finishToken

      public void finishToken()
      Method for forcing full read of current token, even if it might otherwise only be read if data is accessed via getString() and similar methods.
      Overrides:
      finishToken in class tools.jackson.core.base.ParserMinimalBase
    • nextName

      public String nextName() throws tools.jackson.core.JacksonException
      Overrides:
      nextName in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • nextName

      public boolean nextName(tools.jackson.core.SerializableString str) throws tools.jackson.core.JacksonException
      Overrides:
      nextName in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • nextNameMatch

      public int nextNameMatch(tools.jackson.core.sym.PropertyNameMatcher matcher) throws tools.jackson.core.JacksonException
      Overrides:
      nextNameMatch in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • nextStringValue

      public String nextStringValue() throws tools.jackson.core.JacksonException
      Overrides:
      nextStringValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • nextIntValue

      public int nextIntValue(int defaultValue) throws tools.jackson.core.JacksonException
      Overrides:
      nextIntValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • nextLongValue

      public long nextLongValue(long defaultValue) throws tools.jackson.core.JacksonException
      Overrides:
      nextLongValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • nextBooleanValue

      public Boolean nextBooleanValue() throws tools.jackson.core.JacksonException
      Overrides:
      nextBooleanValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getString

      public String getString() throws tools.jackson.core.JacksonException
      Method for accessing textual representation of the current event; if no current event (before first call to nextToken(), or after encountering end-of-input), returns null. Method can be called for any event.
      Specified by:
      getString in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getStringCharacters

      public char[] getStringCharacters() throws tools.jackson.core.JacksonException
      Specified by:
      getStringCharacters in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getStringLength

      public int getStringLength() throws tools.jackson.core.JacksonException
      Specified by:
      getStringLength in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getStringOffset

      public int getStringOffset() throws tools.jackson.core.JacksonException
      Specified by:
      getStringOffset in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getValueAsString

      public String getValueAsString() throws tools.jackson.core.JacksonException
      Overrides:
      getValueAsString in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • getValueAsString

      public String getValueAsString(String defaultValue) throws tools.jackson.core.JacksonException
      Overrides:
      getValueAsString in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • getString

      public int getString(Writer writer) throws tools.jackson.core.JacksonException
      Overrides:
      getString in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • getBinaryValue

      public byte[] getBinaryValue(tools.jackson.core.Base64Variant b64variant) throws tools.jackson.core.JacksonException
      Specified by:
      getBinaryValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • getEmbeddedObject

      public Object getEmbeddedObject() throws tools.jackson.core.JacksonException
      Overrides:
      getEmbeddedObject in class tools.jackson.core.base.ParserMinimalBase
      Throws:
      tools.jackson.core.JacksonException
    • readBinaryValue

      public int readBinaryValue(tools.jackson.core.Base64Variant b64variant, OutputStream out) throws tools.jackson.core.JacksonException
      Overrides:
      readBinaryValue in class tools.jackson.core.JsonParser
      Throws:
      tools.jackson.core.JacksonException
    • _handlePropertyName

      protected final tools.jackson.core.JsonToken _handlePropertyName() throws tools.jackson.core.JacksonException
      Method that handles initial token type recognition for token that has to be either PROPERTY_NAME or END_OBJECT.
      Throws:
      tools.jackson.core.JacksonException
    • _parseNumericValue

      protected void _parseNumericValue() throws tools.jackson.core.JacksonException
      Description copied from class: SmileParserBase
      Method called to complete parsing of a numeric value: will throw StreamReadException if current token is not numeric.
      Specified by:
      _parseNumericValue in class SmileParserBase
      Throws:
      tools.jackson.core.exc.StreamReadException - if current token is not numeric
      tools.jackson.core.JacksonException
    • _parseNumericValueIfNumber

      protected boolean _parseNumericValueIfNumber() throws tools.jackson.core.JacksonException
      Description copied from class: SmileParserBase
      Similar to SmileParserBase._parseNumericValue(), but will not throw exception if the current token is not a numeric value.
      Specified by:
      _parseNumericValueIfNumber in class SmileParserBase
      Returns:
      true if current token is numeric; false otherwise
      Throws:
      tools.jackson.core.JacksonException
    • _finishToken

      protected final void _finishToken() throws tools.jackson.core.JacksonException
      Method called to finish parsing of a token so that token contents are retrievable
      Throws:
      tools.jackson.core.JacksonException
    • _finishNumberToken

      protected final void _finishNumberToken(int tb) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _readUnsignedVInt

      protected final int _readUnsignedVInt() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _readUnsignedVIntSlow

      protected final int _readUnsignedVIntSlow() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _reportInvalidUnsignedVInt

      protected final void _reportInvalidUnsignedVInt(int firstCh, int lastCh) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _decodeShortAsciiValue

      protected final String _decodeShortAsciiValue(int len) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _decodeShortUnicodeValue

      protected final String _decodeShortUnicodeValue(int byteLen) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _finishBinaryRawLong

      protected byte[] _finishBinaryRawLong(int expLen) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _finishBinary7BitLong

      protected byte[] _finishBinary7BitLong(int expLen) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _skipIncomplete

      protected void _skipIncomplete() throws tools.jackson.core.JacksonException
      Method called to skip remainders of an incomplete token, when contents themselves will not be needed any more
      Throws:
      tools.jackson.core.JacksonException
    • _skipBytes

      protected void _skipBytes(int len) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _skip7BitBinary

      protected void _skip7BitBinary() throws tools.jackson.core.JacksonException
      Helper method for skipping length-prefixed binary data section
      Throws:
      tools.jackson.core.JacksonException
    • _reportInvalidSharedName

      protected void _reportInvalidSharedName(int index) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _reportInvalidSharedStringValue

      protected void _reportInvalidSharedStringValue(int index) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _reportInvalidInitial

      protected void _reportInvalidInitial(int mask) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _reportInvalidOther

      protected void _reportInvalidOther(int mask, int ptr) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _reportInvalidOther

      protected void _reportInvalidOther(int mask) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _reportIncompleteBinaryReadRaw

      protected void _reportIncompleteBinaryReadRaw(int expLen, int actLen) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _reportIncompleteBinaryRead7Bit

      protected void _reportIncompleteBinaryRead7Bit(int expLen, int actLen) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _reportTruncatedUTF8InString

      protected String _reportTruncatedUTF8InString(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _reportTruncatedUTF8InName

      protected String _reportTruncatedUTF8InName(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException