Class CBORParser
java.lang.Object
tools.jackson.core.JsonParser
tools.jackson.core.base.ParserMinimalBase
tools.jackson.core.base.ParserBase
tools.jackson.dataformat.cbor.CBORParser
- All Implemented Interfaces:
Closeable, AutoCloseable, tools.jackson.core.Versioned
public class CBORParser
extends tools.jackson.core.base.ParserBase
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classType to keep track of a list of string references.protected static final classType to keep a stack of string refs based on namespaces within the document.static final classClass for keeping track of tags in an optimized manner.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 booleanFlag that indicates whether the input buffer is recyclable (and needs to be returned to recycler once we are done) or not.private intHelper variables used when dealing with chunked content.private intHelper variables used when dealing with chunked content.protected final intBit flag composed of bits that indicate whichCBORReadFeatures are enabled.protected byte[]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.protected InputStreamInput stream that can be used for reading more content, if one in use.protected intQuads used for hash calculationprotected intQuads used for hash calculationprotected intQuads used for hash calculationprotected int[]Temporary buffer used for name parsing.protected StringShared string that should be used in place of _textBuffer when a string reference is used.protected CBORSimpleValueWhen major type 7 value is encountered and exposed asJsonToken.VALUE_EMBEDDED_OBJECT, the value will be stored here.protected CBORReadContextInformation about parser context, context in which the next token is to be parsed (root, array, object).protected CBORParser.StringRefListStackStack of text and binary string references.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 CBORParser.TagListWe will keep track of tag values for possible future use.protected booleanFlag 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 intType byte of the current tokenprivate static final BigIntegerprivate static final BigIntegerprotected static final tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability> protected static final intprivate static final doubleprivate static final doubleprivate static final Charsetprivate static final int[]Fields inherited from class tools.jackson.core.base.ParserBase
_binaryValue, _byteArrayBuilder, _currInputProcessed, _currInputRow, _currInputRowStart, _expLength, _fractLength, _inputEnd, _inputPtr, _intLength, _numberBigDecimal, _numberBigInt, _numberDouble, _numberFloat, _numberInt, _numberIsNaN, _numberLong, _numberNegative, _numberString, _numTypesValid, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotalFields 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
ConstructorsConstructorDescriptionCBORParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int cborFeatures, tools.jackson.core.sym.ByteQuadsCanonicalizer sym, InputStream in, byte[] inputBuffer, int start, int end, boolean bufferRecyclable) -
Method Summary
Modifier and TypeMethodDescriptionprivate final String_addDecodedToSymbols(int len, String name) protected final BigInteger_bigNegative(long l) protected final BigInteger_bigPositive(long l) protected final booleanprotected final boolean_checkNextIsIntInArray(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 voidprotected voidprotected voidprivate final intprivate final intprivate final longprivate final intprivate final Stringprivate final int_decodeChunkedUTF8_3(int c1) private final int_decodeChunkedUTF8_4(int c) private int_decodeChunkLength(int expType) private final String_decodeContiguousName(int len) private final 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 floatprivate final String_decodeLongerName(int len) protected final String_decodeNonStringName(int ch, CBORParser.TagList tags) Method that handles initial token type recognition for token that has to be either PROPERTY_NAME or END_OBJECT.protected final tools.jackson.core.JsonTokentools.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 final int_decodeTag(int lowBits) protected tools.jackson.core.JsonTokenHelper 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 final int_decodeUTF8_3(int c1) private final int_decodeUTF8_4(int c) protected tools.jackson.core.JsonTokenprivate final 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 final 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[]private final voidprivate final booleanReads in a tight loop ASCII text until a non-ASCII char is found.protected byte[]_finishLongContiguousBytes(int expLen) private final String_finishLongText(int len) private final int_finishLongTextAscii(int len) Consumes as many ascii chars as possible in a tight loop.private final String_finishShortText(int len) protected String_finishTextToken(int ch) protected voidMethod called to finish parsing of a token so that token contents are retriableprivate final byte[]_getBinaryFromString(tools.jackson.core.Base64Variant variant) private static int[]_growArrayTo(int[] arr, int minSize) protected voidprotected tools.jackson.core.JsonToken_handleTaggedArray(CBORParser.TagList tags, int len) protected tools.jackson.core.JsonTokenprotected tools.jackson.core.JsonTokenprotected void_invalidToken(int ch) private final voidprotected final 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 final long_long(int i1, int i2) private final intprivate final intprivate final intprivate int_nextFieldDecodeAndAdd(tools.jackson.core.sym.PropertyNameMatcher matcher, int len) private final int_nextFieldFromSymbolsLong(tools.jackson.core.sym.PropertyNameMatcher matcher, int len, int q1, int q2) Method for locating names longer than 8 bytes (in UTF-8)private final int_nextFieldOptimized(tools.jackson.core.sym.PropertyNameMatcher matcher, int len) private int_nextNameEmpty(tools.jackson.core.sym.PropertyNameMatcher matcher) private int_nextNameLong(tools.jackson.core.sym.PropertyNameMatcher matcher, int lenMarker) private int_nextNameNonText(tools.jackson.core.sym.PropertyNameMatcher matcher, int ch) protected String_numberToName(int ch, boolean neg, CBORParser.TagList tags) private static final int_padQuadForNulls(int firstByte) protected intprotected void_parseNumericValue(int expType) private int_readAndWriteBytes(OutputStream out, int total) protected voidMethod 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 String_reportTruncatedUTF8InName(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected) private String_reportTruncatedUTF8InString(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected) protected voidprotected void_skipBytes(int len) protected void_skipBytesL(long llen) protected void_skipChunked(int expectedType) protected voidMethod called to skip remainders of an incomplete token, when contents themselves will not be needed any more.private final int_slow16()private final int_slow32()private final long_slow64()protected final boolean_tryToLoadToHaveAtLeast(int minAvailable) voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidcreateChildArrayContext(int len) protected voidcreateChildObjectContext(int len) tools.jackson.core.TokenStreamLocationOverridden since we do not really have character-based locations, but we do have byte offset to specify.Method that can be called to get the name associated with the current event.tools.jackson.core.TokenStreamLocationOverridden since we do not really have character-based locations, but we do have byte offset to specify.voidMethod for forcing full read of current token, even if it might otherwise only be read if data is accessed viagetString()and similar methods.byte[]getBinaryValue(tools.jackson.core.Base64Variant b64variant) intMethod 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.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.floattools.jackson.core.JsonParser.NumberTypetools.jackson.core.JsonParser.NumberTypeFPfinal NumberMethod for accessing textual representation of the current event; if no current event (before first call tonextToken(), or after encountering end-of-input), returns null.intchar[]intintgetValueAsString(String defaultValue) booleanbooleanisNaN()booleanChecking whether the current token represents anundefinedvalue (0xF7).protected booleanloadMore()protected voidintnextIntValue(int defaultValue) longnextLongValue(long defaultValue) nextName()booleannextName(tools.jackson.core.SerializableString str) intnextNameMatch(tools.jackson.core.sym.PropertyNameMatcher matcher) tools.jackson.core.JsonTokenintreadBinaryValue(tools.jackson.core.Base64Variant b64variant, OutputStream out) inttools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability> tools.jackson.core.TokenStreamContexttools.jackson.core.Versionversion()Methods inherited from class tools.jackson.core.base.ParserBase
_contentReference, _contentReferenceRedacted, _convertBigDecimalToBigInteger, _decodeBase64Escape, _decodeBase64Escape, _decodeEscaped, _eofAsNextChar, _getBigDecimal, _getBigInteger, _getByteArrayBuilder, _getNumberDouble, _getNumberFloat, _growNameDecodeBuffer, _handleBase64MissingPadding, _reportInvalidBase64Char, _reportInvalidBase64Char, close, getBigIntegerValue, getDecimalValue, getDoubleValue, getIntValue, getLongValue, getNumberValueDeferred, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, growArrayBy, reset, resetAsNaN, resetFloat, resetIntMethods 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, getBooleanValue, getByteValue, getLastClearedToken, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, hasCurrentToken, hasToken, hasTokenId, isClosed, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, 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, getObjectId, getSchema, getText, getTextCharacters, getTextLength, getTextOffset, getTypeId, getValueAsBoolean, getValueAsDouble, nonBlockingInputFeeder, readBinaryValue, readString, releaseBuffered
-
Field Details
-
UTF8
-
UTF8_UNIT_CODES
private static final int[] UTF8_UNIT_CODES -
BI_MINUS_ONE
-
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:
-
CBOR_READ_CAPABILITIES
protected static final tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamReadCapability> CBOR_READ_CAPABILITIES -
_formatFeatures
protected final int _formatFeaturesBit flag composed of bits that indicate whichCBORReadFeatures are enabled. -
_streamReadContext
Information about parser context, context in which the next token is to be parsed (root, array, object). -
_chunkLeft
private int _chunkLeftHelper variables used when dealing with chunked content. -
_chunkEnd
private int _chunkEndHelper variables used when dealing with chunked content. -
_tagValues
We will keep track of tag values for possible future use. -
_simpleValue
When major type 7 value is encountered and exposed asJsonToken.VALUE_EMBEDDED_OBJECT, the value will be stored here.- Since:
- 2.20
-
_tokenIncomplete
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) -
_typeByte
protected int _typeByteType byte of the current token -
_stringRefs
Stack of text and binary string references. -
_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[] _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. -
_bufferRecyclable
protected boolean _bufferRecyclableFlag that indicates whether the input buffer is recyclable (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 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. -
BIT_63
-
-
Constructor Details
-
CBORParser
public CBORParser(tools.jackson.core.ObjectReadContext readCtxt, tools.jackson.core.io.IOContext ioCtxt, int parserFeatures, int cborFeatures, tools.jackson.core.sym.ByteQuadsCanonicalizer sym, InputStream in, byte[] inputBuffer, int start, int end, boolean bufferRecyclable)
-
-
Method Details
-
version
public 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
-
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. -
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
-
streamReadContext
public tools.jackson.core.TokenStreamContext streamReadContext()- Specified by:
streamReadContextin classtools.jackson.core.JsonParser
-
assignCurrentValue
- Overrides:
assignCurrentValuein classtools.jackson.core.base.ParserBase
-
currentValue
- Overrides:
currentValuein classtools.jackson.core.base.ParserBase
-
releaseBuffered
- Overrides:
releaseBufferedin classtools.jackson.core.JsonParser
-
streamReadInputSource
- Specified by:
streamReadInputSourcein classtools.jackson.core.JsonParser
-
currentTokenLocation
public 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 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
-
_releaseBuffers
protected void _releaseBuffers()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).- Overrides:
_releaseBuffersin classtools.jackson.core.base.ParserBase
-
_closeInput
protected void _closeInput()- Specified by:
_closeInputin classtools.jackson.core.base.ParserMinimalBase
-
hasStringCharacters
public boolean hasStringCharacters()- Overrides:
hasStringCharactersin classtools.jackson.core.base.ParserBase
-
nextToken
public tools.jackson.core.JsonToken nextToken() throws tools.jackson.core.JacksonException- Specified by:
nextTokenin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
_numberToName
protected String _numberToName(int ch, boolean neg, CBORParser.TagList tags) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_handleTaggedInt
protected tools.jackson.core.JsonToken _handleTaggedInt(CBORParser.TagList tags) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_handleTaggedBinary
protected tools.jackson.core.JsonToken _handleTaggedBinary(CBORParser.TagList tags) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_handleTaggedArray
protected tools.jackson.core.JsonToken _handleTaggedArray(CBORParser.TagList tags, int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_checkNextIsIntInArray
protected final boolean _checkNextIsIntInArray(String typeDesc) throws tools.jackson.core.JacksonException 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).Note that in particular this method DOES NOT reset state that
nextToken()would do, but will change current token type to allow access.- Throws:
tools.jackson.core.JacksonException
-
_checkNextIsEndArray
protected final boolean _checkNextIsEndArray() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
finishToken
public void finishToken() throws tools.jackson.core.JacksonExceptionMethod for forcing full read of current token, even if it might otherwise only be read if data is accessed viagetString()and similar methods.- Overrides:
finishTokenin classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
nextName
public boolean nextName(tools.jackson.core.SerializableString str) throws tools.jackson.core.JacksonException - Overrides:
nextNamein classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
nextName
- Overrides:
nextNamein classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
nextNameMatch
public int nextNameMatch(tools.jackson.core.sym.PropertyNameMatcher matcher) throws tools.jackson.core.JacksonException - Overrides:
nextNameMatchin classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
_nextFieldDecodeAndAdd
private int _nextFieldDecodeAndAdd(tools.jackson.core.sym.PropertyNameMatcher matcher, int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_nextNameNonText
private int _nextNameNonText(tools.jackson.core.sym.PropertyNameMatcher matcher, int ch) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_nextNameEmpty
private int _nextNameEmpty(tools.jackson.core.sym.PropertyNameMatcher matcher) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_nextNameLong
private int _nextNameLong(tools.jackson.core.sym.PropertyNameMatcher matcher, int lenMarker) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_nextFieldOptimized
private final int _nextFieldOptimized(tools.jackson.core.sym.PropertyNameMatcher matcher, int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_nextFieldFromSymbolsLong
private final int _nextFieldFromSymbolsLong(tools.jackson.core.sym.PropertyNameMatcher matcher, int len, int q1, int q2) throws tools.jackson.core.JacksonException Method for locating names longer than 8 bytes (in UTF-8)- Throws:
tools.jackson.core.JacksonException
-
nextStringValue
- Overrides:
nextStringValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
nextIntValue
public int nextIntValue(int defaultValue) throws tools.jackson.core.JacksonException - Overrides:
nextIntValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
nextLongValue
public long nextLongValue(long defaultValue) throws tools.jackson.core.JacksonException - Overrides:
nextLongValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
nextBooleanValue
- Overrides:
nextBooleanValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getString
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. Method can be called for any event.- Specified by:
getStringin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getStringCharacters
public char[] getStringCharacters() throws tools.jackson.core.JacksonException- Specified by:
getStringCharactersin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getStringLength
public int getStringLength() throws tools.jackson.core.JacksonException- Specified by:
getStringLengthin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getStringOffset
public int getStringOffset() throws tools.jackson.core.JacksonException- Specified by:
getStringOffsetin classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
getValueAsString
- Overrides:
getValueAsStringin classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
getValueAsString
-
getString
- Overrides:
getStringin classtools.jackson.core.base.ParserMinimalBase- Throws:
tools.jackson.core.JacksonException
-
getBinaryValue
public byte[] getBinaryValue(tools.jackson.core.Base64Variant b64variant) throws tools.jackson.core.JacksonException - Overrides:
getBinaryValuein classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
getEmbeddedObject
- Overrides:
getEmbeddedObjectin classtools.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:
readBinaryValuein classtools.jackson.core.JsonParser- Throws:
tools.jackson.core.JacksonException
-
_readAndWriteBytes
private int _readAndWriteBytes(OutputStream out, int total) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_getBinaryFromString
private final byte[] _getBinaryFromString(tools.jackson.core.Base64Variant variant) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
isUndefined
public boolean isUndefined()Checking whether the current token represents anundefinedvalue (0xF7).This method allows distinguishing between real
nullandundefined, even ifCBORReadFeature.READ_UNDEFINED_AS_EMBEDDED_OBJECTis disabled and the token is reported asJsonToken.VALUE_NULL.- Returns:
trueif current token is anundefined,falseotherwise
-
isNaN
public boolean isNaN()- Overrides:
isNaNin classtools.jackson.core.base.ParserBase
-
getNumberValue
- Overrides:
getNumberValuein classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
getNumberValueExact
- Overrides:
getNumberValueExactin classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
getNumberType
public tools.jackson.core.JsonParser.NumberType getNumberType() throws tools.jackson.core.JacksonException- Overrides:
getNumberTypein classtools.jackson.core.base.ParserBase- 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
-
getFloatValue
public float getFloatValue() throws tools.jackson.core.JacksonException- Overrides:
getFloatValuein classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
_parseNumericValue
protected void _parseNumericValue(int expType) throws tools.jackson.core.JacksonException - Specified by:
_parseNumericValuein classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
_parseIntValue
protected int _parseIntValue() throws tools.jackson.core.JacksonException- Specified by:
_parseIntValuein classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
_checkNumericValue
protected void _checkNumericValue() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
convertNumberToInt
protected void convertNumberToInt() throws tools.jackson.core.JacksonException- Overrides:
convertNumberToIntin classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
convertNumberToLong
protected void convertNumberToLong() throws tools.jackson.core.JacksonException- Overrides:
convertNumberToLongin classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
convertNumberToBigInteger
protected void convertNumberToBigInteger() throws tools.jackson.core.JacksonException- Overrides:
convertNumberToBigIntegerin classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
convertNumberToFloat
protected void convertNumberToFloat() throws tools.jackson.core.JacksonException- Overrides:
convertNumberToFloatin classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
convertNumberToDouble
protected void convertNumberToDouble() throws tools.jackson.core.JacksonException- Overrides:
convertNumberToDoublein classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
convertNumberToBigDecimal
protected void convertNumberToBigDecimal() throws tools.jackson.core.JacksonException- Overrides:
convertNumberToBigDecimalin classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.JacksonException
-
_finishToken
protected void _finishToken() throws tools.jackson.core.JacksonExceptionMethod called to finish parsing of a token so that token contents are retriable- Throws:
tools.jackson.core.JacksonException
-
_finishTextToken
- Throws:
tools.jackson.core.JacksonException
-
_finishShortText
- Throws:
tools.jackson.core.JacksonException
-
_finishLongText
- Throws:
tools.jackson.core.JacksonException
-
_finishLongTextAscii
private final int _finishLongTextAscii(int len) throws tools.jackson.core.JacksonException Consumes as many ascii chars as possible in a tight loop. Returns the amount of bytes remaining.- Throws:
tools.jackson.core.JacksonException
-
_finishChunkedText
private final void _finishChunkedText() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishChunkedTextAscii
private final boolean _finishChunkedTextAscii() throws tools.jackson.core.JacksonExceptionReads in a tight loop ASCII text until a non-ASCII char is found. If any, then it returns false to signal the caller that the chunk wasn't finished. The caller will keep adding to the _outBuf at the _outPtr position to finish the current text buffer segment- Throws:
tools.jackson.core.JacksonException
-
_loadMoreForChunkIfNeeded
private final void _loadMoreForChunkIfNeeded() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_nextByte
private final int _nextByte() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_nextChunkedByte
private final int _nextChunkedByte() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_nextChunkedByte2
private final int _nextChunkedByte2() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishBytes
protected byte[] _finishBytes(int len) throws tools.jackson.core.JacksonException Helper called to complete reading of binary data ("byte string") in case contents are needed.- Throws:
tools.jackson.core.JacksonException
-
_finishChunkedBytes
protected byte[] _finishChunkedBytes() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_finishLongContiguousBytes
protected byte[] _finishLongContiguousBytes(int expLen) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodePropertyName
protected final tools.jackson.core.JsonToken _decodePropertyName() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_decodeContiguousName
- Throws:
tools.jackson.core.JacksonException
-
_decodeLongerName
- Throws:
tools.jackson.core.JacksonException
-
_decodeChunkedName
- Throws:
tools.jackson.core.JacksonException
-
_decodeNonStringName
protected final String _decodeNonStringName(int ch, CBORParser.TagList tags) throws tools.jackson.core.JacksonException Method that handles initial token type recognition for token that has to be either PROPERTY_NAME or END_OBJECT.- Throws:
tools.jackson.core.JacksonException
-
_findDecodedFromSymbols
Helper 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:
tools.jackson.core.JacksonException
-
_findDecodedLong
private final String _findDecodedLong(int len, int q1, int q2) throws tools.jackson.core.JacksonException Method for locating names longer than 8 bytes (in UTF-8)- Throws:
tools.jackson.core.JacksonException
-
_addDecodedToSymbols
-
_growArrayTo
private static int[] _growArrayTo(int[] arr, int minSize) -
_padQuadForNulls
private static final int _padQuadForNulls(int firstByte) -
_skipIncomplete
protected void _skipIncomplete() throws tools.jackson.core.JacksonExceptionMethod 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:
tools.jackson.core.JacksonException
-
_skipChunked
protected void _skipChunked(int expectedType) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_skipBytesL
protected void _skipBytesL(long llen) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_skipBytes
protected void _skipBytes(int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodeTag
private final int _decodeTag(int lowBits) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodeExplicitLength
private final int _decodeExplicitLength(int lowBits) throws tools.jackson.core.JacksonException Method 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:
tools.jackson.core.JacksonException
-
_decodeChunkLength
private int _decodeChunkLength(int expType) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodeHalfSizeFloat
private float _decodeHalfSizeFloat() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_decode8Bits
private final int _decode8Bits() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_decode16Bits
private final int _decode16Bits() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_slow16
private final int _slow16() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_decode32Bits
private final int _decode32Bits() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_slow32
private final int _slow32() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_decode64Bits
private final long _decode64Bits() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_slow64
private final long _slow64() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_long
private static final long _long(int i1, int i2) -
_decodeUndefinedValue
protected tools.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. -
_decodeSimpleValue
public tools.jackson.core.JsonToken _decodeSimpleValue(int lowBits, int ch) throws tools.jackson.core.JacksonException Helper method that deals with details of decoding unallocated "simple values" and exposing them as expected token.Starting with Jackson 2.20, this behavior can be changed by enabling the
CBORReadFeature.READ_SIMPLE_VALUE_AS_EMBEDDED_OBJECTfeature, in which case simple values are returned asJsonToken.VALUE_EMBEDDED_OBJECTwith an embeddedCBORSimpleValueinstance.- Throws:
tools.jackson.core.JacksonException
-
_decodeUTF8_3
private final int _decodeUTF8_3(int c1) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodeChunkedUTF8_3
private final int _decodeChunkedUTF8_3(int c1) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_decodeUTF8_4
private final int _decodeUTF8_4(int c) throws tools.jackson.core.JacksonException - Returns:
- Character value minus 0x10000; this so that caller can readily expand it to actual surrogates
- Throws:
tools.jackson.core.JacksonException
-
_decodeChunkedUTF8_4
private final int _decodeChunkedUTF8_4(int c) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
loadMore
protected boolean loadMore() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
loadMoreGuaranteed
protected void loadMoreGuaranteed() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_loadToHaveAtLeast
protected final void _loadToHaveAtLeast(int minAvailable) throws tools.jackson.core.JacksonException Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessary- Throws:
tools.jackson.core.JacksonException
-
_tryToLoadToHaveAtLeast
protected final boolean _tryToLoadToHaveAtLeast(int minAvailable) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_handleEOF
protected void _handleEOF() throws tools.jackson.core.exc.StreamReadException- Overrides:
_handleEOFin classtools.jackson.core.base.ParserBase- Throws:
tools.jackson.core.exc.StreamReadException
-
_eofAsNextToken
protected tools.jackson.core.JsonToken _eofAsNextToken() throws tools.jackson.core.JacksonException- Throws:
tools.jackson.core.JacksonException
-
_invalidToken
protected void _invalidToken(int ch) throws tools.jackson.core.exc.StreamReadException - Throws:
tools.jackson.core.exc.StreamReadException
-
_reportUnexpectedBreak
protected void _reportUnexpectedBreak() 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) 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
-
_reportIncompleteBinaryRead
protected void _reportIncompleteBinaryRead(int expLen, int actLen) throws tools.jackson.core.exc.StreamReadException - Throws:
tools.jackson.core.exc.StreamReadException
-
_reportTruncatedUTF8InString
private String _reportTruncatedUTF8InString(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_reportTruncatedUTF8InName
private String _reportTruncatedUTF8InName(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_bigPositive
-
_bigNegative
-
createChildArrayContext
protected void createChildArrayContext(int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
createChildObjectContext
protected void createChildObjectContext(int len) throws tools.jackson.core.JacksonException - Throws:
tools.jackson.core.JacksonException
-
_clearRetainedValues
protected void _clearRetainedValues()
-