Class CBORParser
- java.lang.Object
-
- com.fasterxml.jackson.core.JsonParser
-
- com.fasterxml.jackson.core.base.ParserMinimalBase
-
- com.fasterxml.jackson.dataformat.cbor.CBORParser
-
- All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned,java.io.Closeable,java.lang.AutoCloseable
public class CBORParser extends com.fasterxml.jackson.core.base.ParserMinimalBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCBORParser.FeatureEnumeration that defines all togglable features for CBOR generators.protected static classCBORParser.StringRefListType to keep track of a list of string references.protected static classCBORParser.StringRefListStackType to keep a stack of string refs based on namespaces within the document.static classCBORParser.TagListClass for keeping track of tags in an optimized manner.
-
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 togetBinaryValue(com.fasterxml.jackson.core.Base64Variant)will not need to decode data more than once.protected boolean_bufferRecyclableFlag that indicates whether the input buffer is recycable (and needs to be returned to recycler once we are done) or not.protected com.fasterxml.jackson.core.util.ByteArrayBuilder_byteArrayBuilderByteArrayBuilder is needed if 'getBinaryValue' is called.private int_chunkEndHelper variables used when dealing with chunked content.private int_chunkLeftHelper variables used when dealing with chunked content.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_currInputRowCurrent row location of current point in input buffer, starting from 1, if available.protected int_currInputRowStartCurrent index of the first character of the current row in input buffer.protected byte[]_inputBufferCurrent 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.protected int_inputEndIndex of character after last available one in the buffer.protected int_inputPtrPointer to next available character in bufferprotected java.io.InputStream_inputStreamInput stream that can be used for reading more content, if one in use.protected com.fasterxml.jackson.core.io.IOContext_ioContextI/O context for this reader.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 usinggetTextCharacters()method (instead of String returning alternatives)protected java.math.BigDecimal_numberBigDecimalprotected java.math.BigInteger_numberBigIntprotected double_numberDoubleprotected float_numberFloatprotected int_numberIntprotected long_numberLongprotected int_numTypesValidBitfield that indicates which numeric representations have been calculated for the current typeprotected com.fasterxml.jackson.core.ObjectCodec_objectCodecCodec used for data binding when (if) requested.protected 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 java.lang.String_sharedStringShared string that should be used in place of _textBuffer when a string reference is used.protected com.fasterxml.jackson.core.StreamReadConstraints_streamReadConstraintsprotected CBORReadContext_streamReadContextInformation about parser context, context in which the next token is to be parsed (root, array, object).protected CBORParser.StringRefListStack_stringRefsStack of text and binary string references.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 CBORParser.TagList_tagValuesWe will keep track of tag values for possible future use.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 boolean_tokenIncompleteFlag 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)protected int_tokenInputColColumn on input row that current token starts; 0-based (although in the end it'll be converted to 1-based)protected int_tokenInputRowInput row on which current token starts, 1-basedprotected long_tokenInputTotalTotal number of bytes/characters read before start of current token.protected int_typeByteType byte of the current token(package private) static java.math.BigDecimalBD_MAX_INT(package private) static java.math.BigDecimalBD_MAX_LONG(package private) static java.math.BigDecimalBD_MIN_INT(package private) static java.math.BigDecimalBD_MIN_LONG(package private) static java.math.BigIntegerBI_MAX_INT(package private) static java.math.BigIntegerBI_MAX_LONG(package private) static java.math.BigIntegerBI_MIN_INT(package private) static java.math.BigIntegerBI_MIN_LONGprivate static java.math.BigIntegerBIT_63protected static com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability>CBOR_READ_CAPABILITIESprotected static intLONGEST_NON_CHUNKED_BINARYprivate static doubleMATH_POW_2_10private static doubleMATH_POW_2_NEG14private static java.nio.charset.CharsetUTF8private static int[]UTF8_UNIT_CODES-
Fields inherited from class com.fasterxml.jackson.core.base.ParserMinimalBase
_currToken, _lastClearedToken, 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 Constructor Description CBORParser(com.fasterxml.jackson.core.io.IOContext ctxt, int parserFeatures, int cborFeatures, com.fasterxml.jackson.core.ObjectCodec codec, com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer sym, java.io.InputStream in, byte[] inputBuffer, int start, int end, boolean bufferRecyclable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private java.lang.String_addDecodedToSymbols(int len, java.lang.String name)private java.math.BigInteger_bigNegative(long l)private java.math.BigInteger_bigPositive(long l)protected boolean_checkNextIsEndArray()protected boolean_checkNextIsIntInArray(java.lang.String typeDesc)Heavily simplified method that does a subset of whatnextToken()does to basically only (1) determine that we are gettingJsonToken.VALUE_NUMBER_INT(if not, return with no processing) and (2) if so, prepare state so that number accessor method will work).protected void_checkNumericValue(int expType)protected void_closeInput()private int_decode16Bits()private int_decode32Bits()private long_decode64Bits()private int_decode8Bits()private java.lang.String_decodeChunkedName()private int_decodeChunkedUTF8_3(int c1)private int_decodeChunkedUTF8_4(int c)private int_decodeChunkLength(int expType)private java.lang.String_decodeContiguousName(int len)private int_decodeExplicitLength(int lowBits)Method used to decode explicit length of a variable-length value (or, for indefinite/chunked, indicate that one is not known).private float_decodeHalfSizeFloat()private java.lang.String_decodeLongerName(int len)protected void_decodeNonStringName(int ch, CBORParser.TagList tags)Method that handles initial token type recognition for token that has to be either FIELD_NAME or END_OBJECT.protected com.fasterxml.jackson.core.JsonToken_decodePropertyName()com.fasterxml.jackson.core.JsonToken_decodeSimpleValue(int lowBits, int ch)Helper method that deals with details of decoding unallocated "simple values" and exposing them as expected token.private int_decodeTag(int lowBits)protected com.fasterxml.jackson.core.JsonToken_decodeUndefinedValue()Helper method to encapsulate details of handling of mysterious `undefined` value that is allowed to be used as something encoder could not handle (as per spec), whatever the heck that should be.private int_decodeUTF8_3(int c1)private int_decodeUTF8_4(int c)protected com.fasterxml.jackson.core.JsonToken_eofAsNextToken()private java.lang.String_findDecodedFromSymbols(int len)Helper method for trying to find specified encoded UTF-8 byte sequence from symbol table; if successful avoids actual decoding to String.private java.lang.String_findDecodedLong(int len, int q1, int q2)Method for locating names longer than 8 bytes (in UTF-8)protected byte[]_finishBytes(int len)Helper called to complete reading of binary data ("byte string") in case contents are needed.protected byte[]_finishChunkedBytes()private void_finishChunkedText()protected byte[]_finishLongContiguousBytes(int expLen)private java.lang.String_finishLongText(int len)private java.lang.String_finishShortText(int len)protected java.lang.String_finishTextToken(int ch)protected void_finishToken()Method called to finish parsing of a token so that token contents are retriableprivate byte[]_getBinaryFromString(com.fasterxml.jackson.core.Base64Variant variant)protected com.fasterxml.jackson.core.util.ByteArrayBuilder_getByteArrayBuilder()private static int[]_growArrayTo(int[] arr, int minSize)protected void_handleEOF()protected com.fasterxml.jackson.core.JsonToken_handleTaggedArray(CBORParser.TagList tags, int len)protected com.fasterxml.jackson.core.JsonToken_handleTaggedBinary(CBORParser.TagList tags)protected com.fasterxml.jackson.core.JsonToken_handleTaggedInt(CBORParser.TagList tags)protected void_invalidToken(int ch)protected void_loadToHaveAtLeast(int minAvailable)Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessaryprivate static long_long(int i1, int i2)private int_nextByte()private int_nextChunkedByte()private int_nextChunkedByte2()protected java.lang.String_numberToName(int ch, boolean neg, CBORParser.TagList tags)private static int_padQuadForNulls(int firstByte)private int_readAndWriteBytes(java.io.OutputStream out, int total)protected void_releaseBuffers()Method called to release internal buffers owned by the base reader.protected void_reportIncompleteBinaryRead(int expLen, int actLen)protected void_reportInvalidInitial(int mask)protected void_reportInvalidOther(int mask)protected void_reportInvalidOther(int mask, int ptr)private java.lang.String_reportTruncatedUTF8InName(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected)protected <T> T_reportUnexpectedBreak()protected void_skipBytes(int len)protected void_skipBytesL(long llen)protected void_skipChunked(int expectedType)protected void_skipIncomplete()Method called to skip remainders of an incomplete token, when contents themselves will not be needed any more.private int_slow16()private int_slow32()private long_slow64()protected boolean_tryToLoadToHaveAtLeast(int minAvailable)voidclose()protected voidconvertNumberToBigDecimal()protected voidconvertNumberToBigInteger()protected voidconvertNumberToDouble()protected voidconvertNumberToFloat()protected voidconvertNumberToInt()protected voidconvertNumberToLong()private voidcreateChildArrayContext(int len)private voidcreateChildObjectContext(int len)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.voidfinishToken()Method for forcing full read of current token, even if it might otherwise only be read if data is accessed viagetText()and similar methods.java.math.BigIntegergetBigIntegerValue()byte[]getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant)com.fasterxml.jackson.core.ObjectCodecgetCodec()com.fasterxml.jackson.core.JsonLocationgetCurrentLocation()Deprecated.java.lang.StringgetCurrentName()Deprecated.intgetCurrentTag()Method that can be used to access tag id associated with the most recently decoded value (whether completely, for scalar values, or partially, for Objects/Arrays), if any.CBORParser.TagListgetCurrentTags()Method that can be used to access all tag ids associated with the most recently decoded value (whether completely, for scalar values, or partially, for Objects/Arrays), if any.java.math.BigDecimalgetDecimalValue()doublegetDoubleValue()java.lang.ObjectgetEmbeddedObject()floatgetFloatValue()intgetFormatFeatures()java.lang.ObjectgetInputSource()intgetIntValue()longgetLongValue()com.fasterxml.jackson.core.JsonParser.NumberTypegetNumberType()com.fasterxml.jackson.core.JsonParser.NumberTypeFPgetNumberTypeFP()java.lang.NumbergetNumberValue()java.lang.NumbergetNumberValueExact()CBORReadContextgetParsingContext()com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability>getReadCapabilities()java.lang.StringgetText()Method for accessing textual representation of the current event; if no current event (before first call tonextToken(), or after encountering end-of-input), returns null.intgetText(java.io.Writer writer)char[]getTextCharacters()intgetTextLength()intgetTextOffset()com.fasterxml.jackson.core.JsonLocationgetTokenLocation()Deprecated.java.lang.StringgetValueAsString()java.lang.StringgetValueAsString(java.lang.String defaultValue)booleanhasTextCharacters()booleanisClosed()booleanisNaN()protected booleanloadMore()protected voidloadMoreGuaranteed()java.lang.BooleannextBooleanValue()java.lang.StringnextFieldName()booleannextFieldName(com.fasterxml.jackson.core.SerializableString str)intnextIntValue(int defaultValue)longnextLongValue(long defaultValue)java.lang.StringnextTextValue()com.fasterxml.jackson.core.JsonTokennextToken()voidoverrideCurrentName(java.lang.String name)intreadBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant, java.io.OutputStream out)intreleaseBuffered(java.io.OutputStream out)voidsetCodec(com.fasterxml.jackson.core.ObjectCodec c)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, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, hasCurrentToken, hasToken, hasTokenId, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, 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, getBinaryValue, getBooleanValue, getByteValue, getCurrentValue, getFeatureMask, getNonBlockingInputFeeder, getNumberValueDeferred, getObjectId, getSchema, getShortValue, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, overrideFormatFeatures, overrideStdFeatures, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, requiresCustomCodec, setCurrentValue, setFeatureMask, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchema
-
-
-
-
Field Detail
-
UTF8
private static final java.nio.charset.Charset UTF8
-
UTF8_UNIT_CODES
private static final int[] UTF8_UNIT_CODES
-
MATH_POW_2_10
private static final double MATH_POW_2_10
-
MATH_POW_2_NEG14
private static final double MATH_POW_2_NEG14
-
LONGEST_NON_CHUNKED_BINARY
protected static final int LONGEST_NON_CHUNKED_BINARY
- See Also:
- Constant Field Values
-
CBOR_READ_CAPABILITIES
protected static final com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> CBOR_READ_CAPABILITIES
-
_objectCodec
protected com.fasterxml.jackson.core.ObjectCodec _objectCodec
Codec used for data binding when (if) requested.
-
_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).
-
_currInputRow
protected int _currInputRow
Current row location of current point in input buffer, starting from 1, if available.
-
_currInputRowStart
protected int _currInputRowStart
Current index of the first character of the current row in input buffer. Needed to calculate column position, if necessary; benefit of not having column itself is that this only has to be updated once per line.
-
_tokenInputTotal
protected long _tokenInputTotal
Total number of bytes/characters read before start of current token. For big (gigabyte-sized) sizes are possible, needs to be long, unlike pointers and sizes related to in-memory buffers.
-
_tokenInputRow
protected int _tokenInputRow
Input row on which current token starts, 1-based
-
_tokenInputCol
protected int _tokenInputCol
Column on input row that current token starts; 0-based (although in the end it'll be converted to 1-based)
-
_streamReadContext
protected CBORReadContext _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 usinggetTextCharacters()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)
-
_byteArrayBuilder
protected com.fasterxml.jackson.core.util.ByteArrayBuilder _byteArrayBuilder
ByteArrayBuilder is needed if 'getBinaryValue' is called. If so, we better reuse it for remainder of content.
-
_binaryValue
protected byte[] _binaryValue
We will hold on to decoded binary data, for duration of current event, so that multiple calls togetBinaryValue(com.fasterxml.jackson.core.Base64Variant)will not need to decode data more than once.
-
_chunkLeft
private int _chunkLeft
Helper variables used when dealing with chunked content.
-
_chunkEnd
private int _chunkEnd
Helper variables used when dealing with chunked content.
-
_tagValues
protected CBORParser.TagList _tagValues
We will keep track of tag values for possible future use.- Since:
- 2.15
-
_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)
-
_typeByte
protected int _typeByte
Type byte of the current token
-
_stringRefs
protected CBORParser.StringRefListStack _stringRefs
Stack of text and binary string references.- Since:
- 2.15
-
_sharedString
protected java.lang.String _sharedString
Shared string that should be used in place of _textBuffer when a string reference is used.- Since:
- 2.15
-
_inputStream
protected java.io.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.
-
_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
-
BI_MIN_INT
static final java.math.BigInteger BI_MIN_INT
-
BI_MAX_INT
static final java.math.BigInteger BI_MAX_INT
-
BI_MIN_LONG
static final java.math.BigInteger BI_MIN_LONG
-
BI_MAX_LONG
static final java.math.BigInteger BI_MAX_LONG
-
BD_MIN_LONG
static final java.math.BigDecimal BD_MIN_LONG
-
BD_MAX_LONG
static final java.math.BigDecimal BD_MAX_LONG
-
BD_MIN_INT
static final java.math.BigDecimal BD_MIN_INT
-
BD_MAX_INT
static final java.math.BigDecimal BD_MAX_INT
-
_numTypesValid
protected int _numTypesValid
Bitfield that indicates which numeric representations have been calculated for the current type
-
_numberInt
protected int _numberInt
-
_numberLong
protected long _numberLong
-
_numberFloat
protected float _numberFloat
-
_numberDouble
protected double _numberDouble
-
_numberBigInt
protected java.math.BigInteger _numberBigInt
-
_numberBigDecimal
protected java.math.BigDecimal _numberBigDecimal
-
BIT_63
private static final java.math.BigInteger BIT_63
-
-
Constructor Detail
-
CBORParser
public CBORParser(com.fasterxml.jackson.core.io.IOContext ctxt, int parserFeatures, int cborFeatures, com.fasterxml.jackson.core.ObjectCodec codec, com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer sym, java.io.InputStream in, byte[] inputBuffer, int start, int end, boolean bufferRecyclable)
-
-
Method Detail
-
streamReadConstraints
public com.fasterxml.jackson.core.StreamReadConstraints streamReadConstraints()
- Overrides:
streamReadConstraintsin classcom.fasterxml.jackson.core.JsonParser
-
getCodec
public com.fasterxml.jackson.core.ObjectCodec getCodec()
- Specified by:
getCodecin classcom.fasterxml.jackson.core.JsonParser
-
setCodec
public void setCodec(com.fasterxml.jackson.core.ObjectCodec c)
- Specified by:
setCodecin classcom.fasterxml.jackson.core.JsonParser
-
version
public com.fasterxml.jackson.core.Version version()
- Specified by:
versionin interfacecom.fasterxml.jackson.core.Versioned- Specified by:
versionin classcom.fasterxml.jackson.core.JsonParser
-
getFormatFeatures
public int getFormatFeatures()
- Overrides:
getFormatFeaturesin 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
-
getCurrentTag
public int getCurrentTag()
Method that can be used to access tag id associated with the most recently decoded value (whether completely, for scalar values, or partially, for Objects/Arrays), if any. If no tag was associated with it, -1 is returned.- Since:
- 2.5
-
getCurrentTags
public CBORParser.TagList getCurrentTags()
Method that can be used to access all tag ids associated with the most recently decoded value (whether completely, for scalar values, or partially, for Objects/Arrays), if any.- Since:
- 2.15
-
releaseBuffered
public int releaseBuffered(java.io.OutputStream out) throws java.io.IOException- Overrides:
releaseBufferedin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getInputSource
public java.lang.Object getInputSource()
- Overrides:
getInputSourcein classcom.fasterxml.jackson.core.JsonParser
-
currentLocation
public 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 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 void overrideCurrentName(java.lang.String name)
- Specified by:
overrideCurrentNamein classcom.fasterxml.jackson.core.base.ParserMinimalBase
-
close
public 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
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin classcom.fasterxml.jackson.core.base.ParserMinimalBase
-
getParsingContext
public CBORReadContext getParsingContext()
- Specified by:
getParsingContextin classcom.fasterxml.jackson.core.base.ParserMinimalBase
-
hasTextCharacters
public boolean hasTextCharacters()
- Specified by:
hasTextCharactersin classcom.fasterxml.jackson.core.base.ParserMinimalBase
-
_releaseBuffers
protected void _releaseBuffers() throws java.io.IOExceptionMethod 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).- Throws:
java.io.IOException
-
nextToken
public com.fasterxml.jackson.core.JsonToken nextToken() throws java.io.IOException- Specified by:
nextTokenin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
_numberToName
protected java.lang.String _numberToName(int ch, boolean neg, CBORParser.TagList tags) throws java.io.IOException- Throws:
java.io.IOException
-
_handleTaggedInt
protected com.fasterxml.jackson.core.JsonToken _handleTaggedInt(CBORParser.TagList tags) throws java.io.IOException
- Throws:
java.io.IOException
-
_handleTaggedBinary
protected com.fasterxml.jackson.core.JsonToken _handleTaggedBinary(CBORParser.TagList tags) throws java.io.IOException
- Throws:
java.io.IOException
-
_handleTaggedArray
protected com.fasterxml.jackson.core.JsonToken _handleTaggedArray(CBORParser.TagList tags, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
_checkNextIsIntInArray
protected final boolean _checkNextIsIntInArray(java.lang.String typeDesc) throws java.io.IOExceptionHeavily simplified method that does a subset of whatnextToken()does to basically only (1) determine that we are gettingJsonToken.VALUE_NUMBER_INT(if not, return with no processing) and (2) if so, prepare state so that number accessor method will work).Note that in particular this method DOES NOT reset state that
nextToken()would do, but will change current token type to allow access.- Throws:
java.io.IOException
-
_checkNextIsEndArray
protected final boolean _checkNextIsEndArray() throws java.io.IOException- Throws:
java.io.IOException
-
finishToken
public void finishToken() throws java.io.IOExceptionMethod for forcing full read of current token, even if it might otherwise only be read if data is accessed viagetText()and similar methods.- Overrides:
finishTokenin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
nextFieldName
public boolean nextFieldName(com.fasterxml.jackson.core.SerializableString str) throws java.io.IOException- Overrides:
nextFieldNamein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
nextFieldName
public java.lang.String nextFieldName() throws java.io.IOException- Overrides:
nextFieldNamein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
nextTextValue
public java.lang.String nextTextValue() throws java.io.IOException- Overrides:
nextTextValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
nextIntValue
public int nextIntValue(int defaultValue) throws java.io.IOException- Overrides:
nextIntValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
nextLongValue
public long nextLongValue(long defaultValue) throws java.io.IOException- Overrides:
nextLongValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
nextBooleanValue
public java.lang.Boolean nextBooleanValue() throws java.io.IOException- Overrides:
nextBooleanValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getText
public java.lang.String getText() throws java.io.IOExceptionMethod for accessing textual representation of the current event; if no current event (before first call tonextToken(), or after encountering end-of-input), returns null. Method can be called for any event.- Specified by:
getTextin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getTextCharacters
public char[] getTextCharacters() throws java.io.IOException- Specified by:
getTextCharactersin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getTextLength
public int getTextLength() throws java.io.IOException- Specified by:
getTextLengthin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getTextOffset
public int getTextOffset() throws java.io.IOException- Specified by:
getTextOffsetin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getValueAsString
public java.lang.String getValueAsString() throws java.io.IOException- Overrides:
getValueAsStringin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getValueAsString
public java.lang.String getValueAsString(java.lang.String defaultValue) throws java.io.IOException- Overrides:
getValueAsStringin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getText
public int getText(java.io.Writer writer) throws java.io.IOException- Overrides:
getTextin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getBinaryValue
public byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant) throws java.io.IOException- Specified by:
getBinaryValuein classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
java.io.IOException
-
getEmbeddedObject
public java.lang.Object getEmbeddedObject() throws java.io.IOException- Overrides:
getEmbeddedObjectin classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
readBinaryValue
public int readBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant, java.io.OutputStream out) throws java.io.IOException- Overrides:
readBinaryValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
_readAndWriteBytes
private int _readAndWriteBytes(java.io.OutputStream out, int total) throws java.io.IOException- Throws:
java.io.IOException
-
_getBinaryFromString
private final byte[] _getBinaryFromString(com.fasterxml.jackson.core.Base64Variant variant) throws java.io.IOException- Throws:
java.io.IOException
-
isNaN
public boolean isNaN()
- Overrides:
isNaNin classcom.fasterxml.jackson.core.JsonParser
-
getNumberValue
public 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 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 int getIntValue() throws java.io.IOException- Specified by:
getIntValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getLongValue
public long getLongValue() throws java.io.IOException- Specified by:
getLongValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getBigIntegerValue
public java.math.BigInteger getBigIntegerValue() throws java.io.IOException- Specified by:
getBigIntegerValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getFloatValue
public float getFloatValue() throws java.io.IOException- Specified by:
getFloatValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getDoubleValue
public double getDoubleValue() throws java.io.IOException- Specified by:
getDoubleValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
getDecimalValue
public java.math.BigDecimal getDecimalValue() throws java.io.IOException- Specified by:
getDecimalValuein classcom.fasterxml.jackson.core.JsonParser- Throws:
java.io.IOException
-
_checkNumericValue
protected void _checkNumericValue(int expType) throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToInt
protected void convertNumberToInt() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToLong
protected void convertNumberToLong() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToBigInteger
protected void convertNumberToBigInteger() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToFloat
protected void convertNumberToFloat() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToDouble
protected void convertNumberToDouble() throws java.io.IOException- Throws:
java.io.IOException
-
convertNumberToBigDecimal
protected void convertNumberToBigDecimal() throws java.io.IOException- Throws:
java.io.IOException
-
_finishToken
protected void _finishToken() throws java.io.IOExceptionMethod called to finish parsing of a token so that token contents are retriable- Throws:
java.io.IOException
-
_finishTextToken
protected java.lang.String _finishTextToken(int ch) throws java.io.IOException- Throws:
java.io.IOException- Since:
- 2.6
-
_finishShortText
private final java.lang.String _finishShortText(int len) throws java.io.IOException- Throws:
java.io.IOException
-
_finishLongText
private final java.lang.String _finishLongText(int len) throws java.io.IOException- Throws:
java.io.IOException
-
_finishChunkedText
private final void _finishChunkedText() throws java.io.IOException- Throws:
java.io.IOException
-
_nextByte
private final int _nextByte() throws java.io.IOException- Throws:
java.io.IOException
-
_nextChunkedByte
private final int _nextChunkedByte() throws java.io.IOException- Throws:
java.io.IOException
-
_nextChunkedByte2
private final int _nextChunkedByte2() throws java.io.IOException- Throws:
java.io.IOException
-
_finishBytes
protected byte[] _finishBytes(int len) throws java.io.IOExceptionHelper called to complete reading of binary data ("byte string") in case contents are needed.- Throws:
java.io.IOException
-
_finishChunkedBytes
protected byte[] _finishChunkedBytes() throws java.io.IOException- Throws:
java.io.IOException
-
_finishLongContiguousBytes
protected byte[] _finishLongContiguousBytes(int expLen) throws java.io.IOException- Throws:
java.io.IOException
-
_decodePropertyName
protected final com.fasterxml.jackson.core.JsonToken _decodePropertyName() throws java.io.IOException- Throws:
java.io.IOException
-
_decodeContiguousName
private final java.lang.String _decodeContiguousName(int len) throws java.io.IOException- Throws:
java.io.IOException
-
_decodeLongerName
private final java.lang.String _decodeLongerName(int len) throws java.io.IOException- Throws:
java.io.IOException
-
_decodeChunkedName
private final java.lang.String _decodeChunkedName() throws java.io.IOException- Throws:
java.io.IOException
-
_decodeNonStringName
protected final void _decodeNonStringName(int ch, CBORParser.TagList tags) throws java.io.IOExceptionMethod that handles initial token type recognition for token that has to be either FIELD_NAME or END_OBJECT.- Throws:
java.io.IOException
-
_findDecodedFromSymbols
private final java.lang.String _findDecodedFromSymbols(int len) throws java.io.IOExceptionHelper method for trying to find specified encoded UTF-8 byte sequence from symbol table; if successful avoids actual decoding to String.NOTE: caller MUST ensure input buffer has enough content.
- Throws:
java.io.IOException
-
_findDecodedLong
private final java.lang.String _findDecodedLong(int len, int q1, int q2) throws java.io.IOExceptionMethod for locating names longer than 8 bytes (in UTF-8)- Throws:
java.io.IOException
-
_addDecodedToSymbols
private final java.lang.String _addDecodedToSymbols(int len, java.lang.String name) throws java.io.IOException- Throws:
java.io.IOException
-
_growArrayTo
private static int[] _growArrayTo(int[] arr, int minSize)
-
_padQuadForNulls
private static final int _padQuadForNulls(int firstByte)
-
_skipIncomplete
protected void _skipIncomplete() throws java.io.IOExceptionMethod called to skip remainders of an incomplete token, when contents themselves will not be needed any more. Only called or byte array and text.- Throws:
java.io.IOException
-
_skipChunked
protected void _skipChunked(int expectedType) throws java.io.IOException- Throws:
java.io.IOException
-
_skipBytesL
protected void _skipBytesL(long llen) throws java.io.IOException- Throws:
java.io.IOException
-
_skipBytes
protected void _skipBytes(int len) throws java.io.IOException- Throws:
java.io.IOException
-
_decodeTag
private final int _decodeTag(int lowBits) throws java.io.IOException- Throws:
java.io.IOException
-
_decodeExplicitLength
private final int _decodeExplicitLength(int lowBits) throws java.io.IOExceptionMethod used to decode explicit length of a variable-length value (or, for indefinite/chunked, indicate that one is not known). Note that long (64-bit) length is only allowed if it fits in 32-bit signed int, for now; expectation being that longer values are always encoded as chunks.- Throws:
java.io.IOException
-
_decodeChunkLength
private int _decodeChunkLength(int expType) throws java.io.IOException- Throws:
java.io.IOException
-
_decodeHalfSizeFloat
private float _decodeHalfSizeFloat() throws java.io.IOException- Throws:
java.io.IOException
-
_decode8Bits
private final int _decode8Bits() throws java.io.IOException- Throws:
java.io.IOException
-
_decode16Bits
private final int _decode16Bits() throws java.io.IOException- Throws:
java.io.IOException
-
_slow16
private final int _slow16() throws java.io.IOException- Throws:
java.io.IOException
-
_decode32Bits
private final int _decode32Bits() throws java.io.IOException- Throws:
java.io.IOException
-
_slow32
private final int _slow32() throws java.io.IOException- Throws:
java.io.IOException
-
_decode64Bits
private final long _decode64Bits() throws java.io.IOException- Throws:
java.io.IOException
-
_slow64
private final long _slow64() throws java.io.IOException- Throws:
java.io.IOException
-
_long
private static final long _long(int i1, int i2)
-
_decodeUndefinedValue
protected com.fasterxml.jackson.core.JsonToken _decodeUndefinedValue() throws java.io.IOExceptionHelper method to encapsulate details of handling of mysterious `undefined` value that is allowed to be used as something encoder could not handle (as per spec), whatever the heck that should be. Current definition for 2.9 is that we will be returnJsonToken.VALUE_NULL, but for later versions it is likely that we will alternatively allow decoding asJsonToken.VALUE_EMBEDDED_OBJECTwith "embedded value" of `null`.- Throws:
java.io.IOException- Since:
- 2.9.6
-
_decodeSimpleValue
public com.fasterxml.jackson.core.JsonToken _decodeSimpleValue(int lowBits, int ch) throws java.io.IOExceptionHelper method that deals with details of decoding unallocated "simple values" and exposing them as expected token.As of Jackson 2.12, simple values are exposed as
JsonToken.VALUE_NUMBER_INTs, but in later versions this is planned to be changed to separate value type.- Throws:
java.io.IOException- Since:
- 2.12
-
_decodeUTF8_3
private final int _decodeUTF8_3(int c1) throws java.io.IOException- Throws:
java.io.IOException
-
_decodeChunkedUTF8_3
private final int _decodeChunkedUTF8_3(int c1) throws java.io.IOException- Throws:
java.io.IOException
-
_decodeUTF8_4
private final int _decodeUTF8_4(int c) throws java.io.IOException- Returns:
- Character value minus 0x10000; this so that caller can readily expand it to actual surrogates
- Throws:
java.io.IOException
-
_decodeChunkedUTF8_4
private final int _decodeChunkedUTF8_4(int c) throws java.io.IOException- Throws:
java.io.IOException
-
loadMore
protected boolean loadMore() throws java.io.IOException- Throws:
java.io.IOException
-
loadMoreGuaranteed
protected void loadMoreGuaranteed() throws java.io.IOException- Throws:
java.io.IOException
-
_loadToHaveAtLeast
protected final void _loadToHaveAtLeast(int minAvailable) throws java.io.IOExceptionHelper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessary- Throws:
java.io.IOException
-
_tryToLoadToHaveAtLeast
protected final boolean _tryToLoadToHaveAtLeast(int minAvailable) throws java.io.IOException- Throws:
java.io.IOException
-
_getByteArrayBuilder
protected com.fasterxml.jackson.core.util.ByteArrayBuilder _getByteArrayBuilder()
-
_closeInput
protected void _closeInput() throws java.io.IOException- Throws:
java.io.IOException
-
_handleEOF
protected void _handleEOF() throws com.fasterxml.jackson.core.JsonParseException- Specified by:
_handleEOFin classcom.fasterxml.jackson.core.base.ParserMinimalBase- Throws:
com.fasterxml.jackson.core.JsonParseException
-
_eofAsNextToken
protected com.fasterxml.jackson.core.JsonToken _eofAsNextToken() throws java.io.IOException- Throws:
java.io.IOException
-
_invalidToken
protected void _invalidToken(int ch) throws com.fasterxml.jackson.core.JsonParseException- Throws:
com.fasterxml.jackson.core.JsonParseException
-
_reportUnexpectedBreak
protected <T> T _reportUnexpectedBreak() throws java.io.IOException- Throws:
java.io.IOException
-
_reportInvalidInitial
protected void _reportInvalidInitial(int mask) throws com.fasterxml.jackson.core.JsonParseException- Throws:
com.fasterxml.jackson.core.JsonParseException
-
_reportInvalidOther
protected void _reportInvalidOther(int mask) throws com.fasterxml.jackson.core.JsonParseException- Throws:
com.fasterxml.jackson.core.JsonParseException
-
_reportInvalidOther
protected void _reportInvalidOther(int mask, int ptr) throws com.fasterxml.jackson.core.JsonParseException- Throws:
com.fasterxml.jackson.core.JsonParseException
-
_reportIncompleteBinaryRead
protected void _reportIncompleteBinaryRead(int expLen, int actLen) throws java.io.IOException- Throws:
java.io.IOException
-
_reportTruncatedUTF8InName
private java.lang.String _reportTruncatedUTF8InName(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected) throws java.io.IOException- Throws:
java.io.IOException
-
_bigPositive
private final java.math.BigInteger _bigPositive(long l)
-
_bigNegative
private final java.math.BigInteger _bigNegative(long l)
-
createChildArrayContext
private void createChildArrayContext(int len) throws java.io.IOException- Throws:
java.io.IOException
-
createChildObjectContext
private void createChildObjectContext(int len) throws java.io.IOException- Throws:
java.io.IOException
-
-