Class NonBlockingParserBase

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

public abstract class NonBlockingParserBase extends SmileParserBase
  • Field Details

    • MAJOR_INITIAL

      protected static final int MAJOR_INITIAL
      State right after parser has been constructed, before seeing the first byte to know if there's header.
      See Also:
    • MAJOR_ROOT

      protected static final int MAJOR_ROOT
      State right after parser a root value has been finished, but next token has not yet been recognized.
      See Also:
    • MAJOR_OBJECT_FIELD

      protected static final int MAJOR_OBJECT_FIELD
      See Also:
    • MAJOR_OBJECT_VALUE

      protected static final int MAJOR_OBJECT_VALUE
      See Also:
    • MAJOR_ARRAY_ELEMENT

      protected static final int MAJOR_ARRAY_ELEMENT
      See Also:
    • MAJOR_CLOSED

      protected static final int MAJOR_CLOSED
      State after non-blocking input source has indicated that no more input is forthcoming AND we have exhausted all the input
      See Also:
    • MINOR_HEADER_INITIAL

      protected static final int MINOR_HEADER_INITIAL
      See Also:
    • MINOR_HEADER_INLINE

      protected static final int MINOR_HEADER_INLINE
      See Also:
    • MINOR_PROPERTY_NAME_2BYTE

      protected static final int MINOR_PROPERTY_NAME_2BYTE
      See Also:
    • MINOR_PROPERTY_NAME_LONG

      protected static final int MINOR_PROPERTY_NAME_LONG
      See Also:
    • MINOR_PROPERTY_NAME_SHORT_ASCII

      protected static final int MINOR_PROPERTY_NAME_SHORT_ASCII
      See Also:
    • MINOR_PROPERTY_NAME_SHORT_UNICODE

      protected static final int MINOR_PROPERTY_NAME_SHORT_UNICODE
      See Also:
    • MINOR_VALUE_NUMBER_INT

      protected static final int MINOR_VALUE_NUMBER_INT
      See Also:
    • MINOR_VALUE_NUMBER_LONG

      protected static final int MINOR_VALUE_NUMBER_LONG
      See Also:
    • MINOR_VALUE_NUMBER_FLOAT

      protected static final int MINOR_VALUE_NUMBER_FLOAT
      See Also:
    • MINOR_VALUE_NUMBER_DOUBLE

      protected static final int MINOR_VALUE_NUMBER_DOUBLE
      See Also:
    • MINOR_VALUE_NUMBER_BIGINT_LEN

      protected static final int MINOR_VALUE_NUMBER_BIGINT_LEN
      See Also:
    • MINOR_VALUE_NUMBER_BIGINT_BODY

      protected static final int MINOR_VALUE_NUMBER_BIGINT_BODY
      See Also:
    • MINOR_VALUE_NUMBER_BIGDEC_SCALE

      protected static final int MINOR_VALUE_NUMBER_BIGDEC_SCALE
      See Also:
    • MINOR_VALUE_NUMBER_BIGDEC_LEN

      protected static final int MINOR_VALUE_NUMBER_BIGDEC_LEN
      See Also:
    • MINOR_VALUE_NUMBER_BIGDEC_BODY

      protected static final int MINOR_VALUE_NUMBER_BIGDEC_BODY
      See Also:
    • MINOR_VALUE_STRING_SHORT_ASCII

      protected static final int MINOR_VALUE_STRING_SHORT_ASCII
      See Also:
    • MINOR_VALUE_STRING_SHORT_UNICODE

      protected static final int MINOR_VALUE_STRING_SHORT_UNICODE
      See Also:
    • MINOR_VALUE_STRING_LONG_ASCII

      protected static final int MINOR_VALUE_STRING_LONG_ASCII
      See Also:
    • MINOR_VALUE_STRING_LONG_UNICODE

      protected static final int MINOR_VALUE_STRING_LONG_UNICODE
      See Also:
    • MINOR_VALUE_STRING_SHARED_2BYTE

      protected static final int MINOR_VALUE_STRING_SHARED_2BYTE
      See Also:
    • MINOR_VALUE_BINARY_RAW_LEN

      protected static final int MINOR_VALUE_BINARY_RAW_LEN
      See Also:
    • MINOR_VALUE_BINARY_RAW_BODY

      protected static final int MINOR_VALUE_BINARY_RAW_BODY
      See Also:
    • MINOR_VALUE_BINARY_7BIT_LEN

      protected static final int MINOR_VALUE_BINARY_7BIT_LEN
      See Also:
    • MINOR_VALUE_BINARY_7BIT_BODY

      protected static final int MINOR_VALUE_BINARY_7BIT_BODY
      See Also:
    • _majorState

      protected int _majorState
      Current main decoding state
    • _minorState

      protected int _minorState
      Addition indicator within state; contextually relevant for just that state
    • _majorStateAfterValue

      protected int _majorStateAfterValue
      Value of _majorState after completing a scalar value
    • _endOfInput

      protected boolean _endOfInput
      Flag that is sent when calling application indicates that there will be no more input to parse.
    • _inputCopy

      protected byte[] _inputCopy
      Temporary buffer for holding content if input not contiguous (but can fit in buffer)
    • _inputCopyLen

      protected int _inputCopyLen
      Number of bytes buffered in _inputCopy
    • _pending32

      protected int _pending32
      Temporary storage for 32-bit values (int, float), as well as length markers for length-prefixed values.
    • _pending64

      protected long _pending64
      Temporary storage for 64-bit values (long, double), secondary storage for some other things (scale of BigDecimal values)
    • _byteArrayBuilder

      protected tools.jackson.core.util.ByteArrayBuilder _byteArrayBuilder
      ByteArrayBuilder is needed if 'getBinaryValue' is called. If so, we better reuse it for remainder of content.
  • Constructor Details

    • NonBlockingParserBase

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

    • canParseAsync

      public boolean canParseAsync()
      Overrides:
      canParseAsync 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
    • symbolTableForTests

      protected tools.jackson.core.sym.ByteQuadsCanonicalizer symbolTableForTests()
    • releaseBuffered

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

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

      protected void _closeInput()
      Specified by:
      _closeInput in class SmileParserBase
    • _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.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
    • hasStringCharacters

      public boolean hasStringCharacters()
      Specified by:
      hasStringCharacters in class tools.jackson.core.JsonParser
    • 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 JsonParser.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
    • getString

      public int getString(Writer w) 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
    • _startArrayScope

      protected final tools.jackson.core.JsonToken _startArrayScope() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _startObjectScope

      protected final tools.jackson.core.JsonToken _startObjectScope() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _closeArrayScope

      protected final tools.jackson.core.JsonToken _closeArrayScope() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _closeObjectScope

      protected final tools.jackson.core.JsonToken _closeObjectScope() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _findDecodedFromSymbols

      protected final String _findDecodedFromSymbols(byte[] inBuf, int inPtr, int len) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _findDecodedLonger

      private final String _findDecodedLonger(byte[] inBuf, int inPtr, int len) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _addDecodedToSymbols

      protected final String _addDecodedToSymbols(int len, String name)
    • _expandSeenNames

      protected final String[] _expandSeenNames(String[] oldShared)
      Method called to try to expand shared name area to fit one more potentially shared String. If area is already at its biggest size, will just clear the area (by setting next-offset to 0)
    • _eofAsNextToken

      protected final tools.jackson.core.JsonToken _eofAsNextToken() throws tools.jackson.core.JacksonException
      Helper method called at point when all input has been exhausted and input feeder has indicated no more input will be forthcoming.
      Throws:
      tools.jackson.core.JacksonException
    • _valueComplete

      protected final tools.jackson.core.JsonToken _valueComplete(tools.jackson.core.JsonToken t) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _handleSharedString

      protected final tools.jackson.core.JsonToken _handleSharedString(int index) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _handleSharedName

      protected final tools.jackson.core.JsonToken _handleSharedName(int index) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _addSeenStringValue

      protected final void _addSeenStringValue(String v) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _expandSeenStringValues

      private final void _expandSeenStringValues(String v)
    • _initByteArrayBuilder

      public void _initByteArrayBuilder()
    • _reportMissingHeader

      protected void _reportMissingHeader(int unmaskedFirstByte) throws tools.jackson.core.exc.StreamReadException
      Throws:
      tools.jackson.core.exc.StreamReadException
    • _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