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
FieldsModifier and TypeFieldDescriptionprotected byte[]We will hold on to decoded binary data, for duration of current event, so that multiple calls toJsonParser.getBinaryValue(Base64Variant)will not need to decode data more than once.protected longNumber of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer).protected intBit flag composed of bits that indicate whichSmileReadFeatures are enabled.protected intIndex of character after last available one in the buffer.protected intPointer to next available character in bufferprotected booleanFlag that indicates whether content can legally have raw (unquoted) binary data.protected BigDecimalprotected BigIntegerprotected doubleprotected floatprotected intprotected longprotected tools.jackson.core.JsonParser.NumberTypeprotected intBitfield that indicates which numeric representations have been calculated for the current typeprotected intQuads used for hash calculationprotected intQuads used for hash calculationprotected intQuads used for hash calculationprotected int[]Temporary buffer used for name parsing.protected intprotected String[]Array of recently seen field names, which may be back referenced by later fields.protected intprotected 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.SimpleStreamReadContextInformation about parser context, context in which the next token is to be parsed (root, array, object).protected final tools.jackson.core.sym.ByteQuadsCanonicalizerSymbol table that contains field names encountered so farprotected final booleanMarker flag to indicate that standard symbol handling is used (one with symbol table assisted canonicalization.protected final tools.jackson.core.util.TextBufferBuffer 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 intAlternative to_tokenInputTotalthat will only contain offset within input buffer, as int.protected static final intprotected static final intprotected static final intprotected 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_DEFAULTSFields inherited from class tools.jackson.core.JsonParser
DEFAULT_READ_CAPABILITIES -
Constructor Summary
ConstructorsConstructorDescriptionSmileParserBase(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 TypeMethodDescriptionprotected abstract voidprotected voidMethod called when an EOF is encountered between tokens.protected abstract voidMethod called to complete parsing of a numeric value: will throwStreamReadExceptionif current token is not numeric.protected abstract booleanSimilar to_parseNumericValue(), but will not throw exception if the current token is not a numeric value.protected final voidprotected abstract voidprotected void_reportMismatchedEndMarker(int actCh, char expCh) protected tools.jackson.core.io.ContentReferenceHelper method used to encapsulate logic of including (or not) of "source reference" when constructingTokenStreamLocationinstances.voidfinal voidclose()protected final voidprotected final voidprotected final voidprotected final voidprotected final voidprotected final voidfinal tools.jackson.core.TokenStreamLocationOverridden since we do not really have character-based locations, but we do have byte offset to specify.final StringMethod that can be called to get the name associated with the current event.final tools.jackson.core.TokenStreamLocationOverridden since we do not really have character-based locations, but we do have byte offset to specify.final BigIntegerfinal BigDecimalfinal doublefinal floatfinal intfinal longfinal tools.jackson.core.JsonParser.NumberTypetools.jackson.core.JsonParser.NumberTypeFPfinal Numberfinal Numberfinal booleanisClosed()final booleanisNaN()final booleantools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability> final tools.jackson.core.util.SimpleStreamReadContextfinal tools.jackson.core.Versionversion()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, streamReadFeaturesMethods 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
-
Field Details
-
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 _formatFeaturesBit flag composed of bits that indicate whichSmileReadFeatures are enabled.NOTE: currently the only feature (
SmileReadFeature.REQUIRE_HEADERtakes effect during bootstrapping. -
_mayContainRawBinary
protected boolean _mayContainRawBinaryFlag 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 _inputPtrPointer to next available character in buffer -
_inputEnd
protected int _inputEndIndex of character after last available one in the buffer. -
_currInputProcessed
protected long _currInputProcessedNumber of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer). -
_tokenOffsetForTotal
protected int _tokenOffsetForTotalAlternative to_tokenInputTotalthat will only contain offset within input buffer, as int. -
_streamReadContext
protected tools.jackson.core.util.SimpleStreamReadContext _streamReadContextInformation about parser context, context in which the next token is to be parsed (root, array, object). -
_textBuffer
protected final tools.jackson.core.util.TextBuffer _textBufferBuffer 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[] _binaryValueWe will hold on to decoded binary data, for duration of current event, so that multiple calls toJsonParser.getBinaryValue(Base64Variant)will not need to decode data more than once. -
_numberType
protected tools.jackson.core.JsonParser.NumberType _numberType -
_numTypesValid
protected int _numTypesValidBitfield that indicates which numeric representations have been calculated for the current type -
_numberBigInt
-
_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 _symbolsSymbol table that contains field names encountered so far -
_quadBuffer
protected int[] _quadBufferTemporary buffer used for name parsing. -
_quad1
protected int _quad1Quads used for hash calculation -
_quad2
protected int _quad2Quads used for hash calculation -
_quad3
protected int _quad3Quads used for hash calculation -
_symbolsCanonical
protected final boolean _symbolsCanonicalMarker 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
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
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:
versionin interfacetools.jackson.core.Versioned- Specified by:
versionin classtools.jackson.core.JsonParser
-
streamReadCapabilities
public tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability> streamReadCapabilities()- Overrides:
streamReadCapabilitiesin classtools.jackson.core.base.ParserMinimalBase
-
mayContainRawBinary
public final boolean mayContainRawBinary() -
_closeInput
protected abstract void _closeInput() throws tools.jackson.core.JacksonException- Specified by:
_closeInputin classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
_parseNumericValue
protected abstract void _parseNumericValue() throws tools.jackson.core.JacksonExceptionMethod called to complete parsing of a numeric value: will throwStreamReadExceptionif current token is not numeric.- Throws:
tools.jackson.core.exc.StreamReadException- if current token is not numerictools.jackson.core.JacksonException
-
_parseNumericValueIfNumber
protected abstract boolean _parseNumericValueIfNumber() throws tools.jackson.core.JacksonExceptionSimilar to_parseNumericValue(), but will not throw exception if the current token is not a numeric value.- Returns:
trueif current token is numeric;falseotherwise- Throws:
tools.jackson.core.JacksonException
-
streamReadContext
public final tools.jackson.core.util.SimpleStreamReadContext streamReadContext()- Specified by:
streamReadContextin classtools.jackson.core.JsonParser
-
assignCurrentValue
- Specified by:
assignCurrentValuein classtools.jackson.core.JsonParser
-
currentValue
- Specified by:
currentValuein classtools.jackson.core.JsonParser
-
isClosed
public final boolean isClosed()- Overrides:
isClosedin classtools.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:
currentTokenLocationin classtools.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:
currentLocationin classtools.jackson.core.JsonParser
-
currentName
Method that can be called to get the name associated with the current event.- Specified by:
currentNamein classtools.jackson.core.JsonParser
-
close
public final void close() throws tools.jackson.core.JacksonException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
_releaseBuffers
protected final void _releaseBuffers()- Specified by:
_releaseBuffersin classtools.jackson.core.base.ParserMinimalBase
-
_releaseBuffers2
protected abstract void _releaseBuffers2() -
isNaN
public final boolean isNaN() throws tools.jackson.core.JacksonException- Specified by:
isNaNin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getNumberValue
- Specified by:
getNumberValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getNumberValueExact
- Overrides:
getNumberValueExactin classtools.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:
getNumberTypein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getNumberTypeFP
public tools.jackson.core.JsonParser.NumberTypeFP getNumberTypeFP() throws tools.jackson.core.JacksonException- Overrides:
getNumberTypeFPin classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
getIntValue
public final int getIntValue() throws tools.jackson.core.JacksonException- Specified by:
getIntValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getLongValue
public final long getLongValue() throws tools.jackson.core.JacksonException- Specified by:
getLongValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getBigIntegerValue
- Specified by:
getBigIntegerValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getFloatValue
public final float getFloatValue() throws tools.jackson.core.JacksonException- Specified by:
getFloatValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getDoubleValue
public final double getDoubleValue() throws tools.jackson.core.JacksonException- Specified by:
getDoubleValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getDecimalValue
- Specified by:
getDecimalValuein classtools.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.StreamReadExceptionMethod 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:
_handleEOFin classtools.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 constructingTokenStreamLocationinstances.
-