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,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
NonBlockingParserBase,SmileParser
public abstract class SmileParserBase extends com.fasterxml.jackson.core.base.ParserMinimalBase- Since:
- 2.9
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]_binaryValueWe will hold on to decoded binary data, for duration of current event, so that multiple calls toParserMinimalBase.getBinaryValue(com.fasterxml.jackson.core.Base64Variant)will not need to decode data more than once.protected boolean_closedFlag that indicates whether parser is closed or not.protected long_currInputProcessedNumber of characters/bytes that were contained in previous blocks (blocks that were already processed prior to the current buffer).protected int_formatFeaturesBit flag composed of bits that indicate whichSmileParser.Features are enabled.protected int_inputEndIndex of character after last available one in the buffer.protected int_inputPtrPointer to next available character in bufferprotected com.fasterxml.jackson.core.io.IOContext_ioContextI/O context for this reader.protected boolean_mayContainRawBinaryFlag that indicates whether content can legally have raw (unquoted) binary data.protected boolean_nameCopiedFlag 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[]_nameCopyBufferTemporary buffer that is needed if field name is accessed usingParserMinimalBase.getTextCharacters()method (instead of String returning alternatives)protected java.math.BigDecimal_numberBigDecimalprotected java.math.BigInteger_numberBigIntprotected double_numberDoubleprotected float_numberFloatprotected int_numberIntprotected long_numberLongprotected com.fasterxml.jackson.core.JsonParser.NumberType_numberTypeprotected int_numTypesValidBitfield that indicates which numeric representations have been calculated for the current typeprotected int_quad1Quads used for hash calculationprotected int_quad2Quads used for hash calculationprotected int_quad3Quads used for hash calculationprotected int[]_quadBufferTemporary buffer used for name parsing.protected int_seenNameCountprotected java.lang.String[]_seenNamesArray of recently seen field names, which may be back referenced by later fields.protected int_seenStringValueCountprotected java.lang.String[]_seenStringValuesArray of recently seen field names, which may be back referenced by later fields Defaults set to disable handling if no header found.protected com.fasterxml.jackson.core.StreamReadConstraints_streamReadConstraintsprotected com.fasterxml.jackson.core.json.JsonReadContext_streamReadContextInformation about parser context, context in which the next token is to be parsed (root, array, object).protected com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer_symbolsSymbol table that contains field names encountered so farprotected boolean_symbolsCanonicalMarker flag to indicate that standard symbol handling is used (one with symbol table assisted canonicalization.protected com.fasterxml.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)protected int_tokenOffsetForTotalAlternative to_tokenInputTotalthat will only contain offset within input buffer, as int.protected static intDEFAULT_NAME_BUFFER_LENGTHprotected static intDEFAULT_STRING_VALUE_BUFFER_LENGTHprotected static intLONGEST_NON_CHUNKED_BINARYprotected static java.lang.String[]NO_STRINGSprotected static com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability>SMILE_READ_CAPABILITIES-
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSmileParserBase(com.fasterxml.jackson.core.io.IOContext ctxt, int parserFeatures, int formatFeatures, com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer sym)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract void_closeInput()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 com.fasterxml.jackson.core.io.ContentReference_sourceReference()Helper method used to encapsulate logic of including (or not) of "source reference" when constructingJsonLocationinstances.voidclose()protected voidconvertNumberToBigDecimal()protected voidconvertNumberToBigInteger()protected voidconvertNumberToDouble()protected voidconvertNumberToFloat()protected voidconvertNumberToInt()protected voidconvertNumberToLong()com.fasterxml.jackson.core.JsonLocationcurrentLocation()Overridden since we do not really have character-based locations, but we do have byte offset to specify.java.lang.StringcurrentName()Method that can be called to get the name associated with the current event.com.fasterxml.jackson.core.JsonLocationcurrentTokenLocation()Overridden since we do not really have character-based locations, but we do have byte offset to specify.java.math.BigIntegergetBigIntegerValue()com.fasterxml.jackson.core.JsonLocationgetCurrentLocation()Deprecated.java.lang.StringgetCurrentName()Deprecated.java.math.BigDecimalgetDecimalValue()doublegetDoubleValue()floatgetFloatValue()intgetFormatFeatures()intgetIntValue()longgetLongValue()com.fasterxml.jackson.core.JsonParser.NumberTypegetNumberType()com.fasterxml.jackson.core.JsonParser.NumberTypeFPgetNumberTypeFP()java.lang.NumbergetNumberValue()java.lang.NumbergetNumberValueExact()com.fasterxml.jackson.core.json.JsonReadContextgetParsingContext()com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability>getReadCapabilities()com.fasterxml.jackson.core.JsonLocationgetTokenLocation()Deprecated.booleanisClosed()booleanisNaN()booleanmayContainRawBinary()voidoverrideCurrentName(java.lang.String name)com.fasterxml.jackson.core.JsonParseroverrideFormatFeatures(int values, int mask)com.fasterxml.jackson.core.StreamReadConstraintsstreamReadConstraints()com.fasterxml.jackson.core.Versionversion()-
Methods inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
_ascii, _asciiBytes, _constructError, _currentLocationMinusOne, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportMissingRootWS, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _throwInternalReturnAny, _throwInvalidSpace, _wrapError, clearCurrentToken, currentToken, currentTokenId, getBinaryValue, getCurrentToken, getCurrentTokenId, getLastClearedToken, getText, getTextCharacters, getTextLength, getTextOffset, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasTextCharacters, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, nextToken, nextValue, reportInvalidNumber, reportOverflowInt, reportOverflowInt, reportOverflowInt, reportOverflowLong, reportOverflowLong, reportOverflowLong, reportUnexpectedNumberChar, skipChildren
-
Methods inherited from class com.fasterxml.jackson.core.JsonParser
_codec, _constructError, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, assignCurrentValue, canParseAsync, canReadObjectId, canReadTypeId, canUseSchema, configure, currentValue, disable, enable, finishToken, getBinaryValue, getBooleanValue, getByteValue, getCodec, getCurrentValue, getEmbeddedObject, getFeatureMask, getInputSource, getNonBlockingInputFeeder, getNumberValueDeferred, getObjectId, getSchema, getShortValue, getText, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, 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
-
-
-
-
Field Detail
-
NO_STRINGS
protected static final java.lang.String[] NO_STRINGS
-
LONGEST_NON_CHUNKED_BINARY
protected static final int LONGEST_NON_CHUNKED_BINARY
- See Also:
- Constant Field Values
-
DEFAULT_NAME_BUFFER_LENGTH
protected static final int DEFAULT_NAME_BUFFER_LENGTH
- See Also:
- Constant Field Values
-
DEFAULT_STRING_VALUE_BUFFER_LENGTH
protected static final int DEFAULT_STRING_VALUE_BUFFER_LENGTH
- See Also:
- Constant Field Values
-
SMILE_READ_CAPABILITIES
protected static final com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> SMILE_READ_CAPABILITIES
-
_formatFeatures
protected int _formatFeatures
Bit flag composed of bits that indicate whichSmileParser.Features are enabled.NOTE: currently the only feature (
SmileParser.Feature.REQUIRE_HEADERtakes 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.
-
_streamReadConstraints
protected final com.fasterxml.jackson.core.StreamReadConstraints _streamReadConstraints
- Since:
- 2.17
-
_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_tokenInputTotalthat will only contain offset within input buffer, as int.
-
_streamReadContext
protected com.fasterxml.jackson.core.json.JsonReadContext _streamReadContext
Information about parser context, context in which the next token is to be parsed (root, array, object).NOTE: before 2.13 was "_parsingContext"
-
_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 usingParserMinimalBase.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 toParserMinimalBase.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 java.math.BigInteger _numberBigInt
-
_numberBigDecimal
protected java.math.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
-
_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.- Since:
- 2.13
-
_seenNames
protected java.lang.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 java.lang.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
-
-
Method Detail
-
streamReadConstraints
public com.fasterxml.jackson.core.StreamReadConstraints streamReadConstraints()
- Overrides:
streamReadConstraintsin classcom.fasterxml.jackson.core.JsonParser
-
version
public final com.fasterxml.jackson.core.Version version()
- Specified by:
versionin interfacecom.fasterxml.jackson.core.Versioned- Specified by:
versionin classcom.fasterxml.jackson.core.JsonParser
-
mayContainRawBinary
public final boolean mayContainRawBinary()
-
getFormatFeatures
public final int getFormatFeatures()
- Overrides:
getFormatFeaturesin classcom.fasterxml.jackson.core.JsonParser
-
overrideFormatFeatures
public final com.fasterxml.jackson.core.JsonParser overrideFormatFeatures(int values, int mask)- Overrides:
overrideFormatFeaturesin classcom.fasterxml.jackson.core.JsonParser
-
getReadCapabilities
public com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> getReadCapabilities()
- Overrides:
getReadCapabilitiesin classcom.fasterxml.jackson.core.JsonParser
-
_closeInput
protected abstract void _closeInput() throws java.io.IOException- Throws:
java.io.IOException
-
_parseNumericValue
protected abstract void _parseNumericValue() throws java.io.IOException- Throws:
java.io.IOException
-
currentLocation
public final com.fasterxml.jackson.core.JsonLocation currentLocation()
Overridden since we do not really have character-based locations, but we do have byte offset to specify.- Overrides:
currentLocationin classcom.fasterxml.jackson.core.JsonParser
-
currentTokenLocation
public final com.fasterxml.jackson.core.JsonLocation currentTokenLocation()
Overridden since we do not really have character-based locations, but we do have byte offset to specify.- Overrides:
currentTokenLocationin classcom.fasterxml.jackson.core.JsonParser
-
getCurrentLocation
@Deprecated public com.fasterxml.jackson.core.JsonLocation getCurrentLocation()
Deprecated.- Specified by:
getCurrentLocationin classcom.fasterxml.jackson.core.JsonParser
-
getTokenLocation
@Deprecated public com.fasterxml.jackson.core.JsonLocation getTokenLocation()
Deprecated.- Specified by:
getTokenLocationin classcom.fasterxml.jackson.core.JsonParser
-
currentName
public java.lang.String currentName() throws java.io.IOExceptionMethod that can be called to get the name associated with the current event.- Overrides:
currentNamein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getCurrentName
@Deprecated public java.lang.String getCurrentName() throws java.io.IOExceptionDeprecated.- Specified by:
getCurrentNamein classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
overrideCurrentName
public final void overrideCurrentName(java.lang.String name)
- Specified by:
overrideCurrentNamein classcom.fasterxml.jackson.core.base.ParserMinimalBase
-
close
public final void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
_releaseBuffers
protected final void _releaseBuffers() throws java.io.IOException- Throws:
java.io.IOException
-
_releaseBuffers2
protected abstract void _releaseBuffers2()
-
isClosed
public final boolean isClosed()
- Specified by:
isClosedin classcom.fasterxml.jackson.core.base.ParserMinimalBase
-
getParsingContext
public final com.fasterxml.jackson.core.json.JsonReadContext getParsingContext()
- Specified by:
getParsingContextin classcom.fasterxml.jackson.core.base.ParserMinimalBase
-
isNaN
public final boolean isNaN() throws java.io.IOException- Overrides:
isNaNin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getNumberValue
public final java.lang.Number getNumberValue() throws java.io.IOException- Specified by:
getNumberValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getNumberValueExact
public final java.lang.Number getNumberValueExact() throws java.io.IOException- Overrides:
getNumberValueExactin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getNumberType
public final com.fasterxml.jackson.core.JsonParser.NumberType getNumberType() throws java.io.IOException- Specified by:
getNumberTypein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getNumberTypeFP
public com.fasterxml.jackson.core.JsonParser.NumberTypeFP getNumberTypeFP() throws java.io.IOException- Overrides:
getNumberTypeFPin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getIntValue
public final int getIntValue() throws java.io.IOException- Specified by:
getIntValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getLongValue
public final long getLongValue() throws java.io.IOException- Specified by:
getLongValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getBigIntegerValue
public final java.math.BigInteger getBigIntegerValue() throws java.io.IOException- Specified by:
getBigIntegerValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getFloatValue
public final float getFloatValue() throws java.io.IOException- Specified by:
getFloatValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getDoubleValue
public final double getDoubleValue() throws java.io.IOException- Specified by:
getDoubleValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getDecimalValue
public final java.math.BigDecimal getDecimalValue() throws java.io.IOException- Specified by:
getDecimalValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
convertNumberToInt
protected final void convertNumberToInt() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToLong
protected final void convertNumberToLong() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToBigInteger
protected final void convertNumberToBigInteger() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToFloat
protected final void convertNumberToFloat() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToDouble
protected final void convertNumberToDouble() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToBigDecimal
protected final void convertNumberToBigDecimal() throws java.io.IOException- Throws:
java.io.IOException
-
_handleEOF
protected void _handleEOF() throws com.fasterxml.jackson.core.JsonParseExceptionMethod 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 classcom.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
-
_sourceReference
protected com.fasterxml.jackson.core.io.ContentReference _sourceReference()
Helper method used to encapsulate logic of including (or not) of "source reference" when constructingJsonLocationinstances.- Since:
- 2.13
-
-