Top Fields Constructors Methods
tools.jackson.dataformat.smile

public Class SmileParser

extends SmileParserBase
Class Inheritance
Static Imports
tools.jackson.dataformat.smile.SmileConstants.BYTE_MARKER_END_OF_STRING

Field Summary

Modifier and TypeField and Description
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.

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.

protected InputStream
_inputStream

Input stream that can be used for reading more content, if one in use.

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)

protected int
_typeAsInt

Type byte of the current token (as in)

private static final boolean
JDK11_OR_LATER

Flag to indicate if the JDK version is 11 or later.

Inherited from tools.jackson.dataformat.smile.SmileParserBase:
_binaryValue_currInputProcessed_formatFeatures_inputEnd_inputPtr_mayContainRawBinary_numberBigDecimal_numberBigInt_numberDouble_numberFloat_numberInt_numberLong_numberType_numTypesValid_quad1_quad2_quad3_quadBuffer_seenNameCount_seenNames_seenStringValueCount_seenStringValues_streamReadContext_symbols_symbolsCanonical_textBuffer_tokenOffsetForTotalDEFAULT_NAME_BUFFER_LENGTHDEFAULT_STRING_VALUE_BUFFER_LENGTHLONGEST_NON_CHUNKED_BINARYNO_STRINGSSMILE_READ_CAPABILITIES

Constructor Summary

AccessConstructor and Description
public
SmileParser(ObjectReadContext readCtxt, IOContext ctxt, int parserFeatures, int smileFeatures, ByteQuadsCanonicalizer sym, InputStream in, byte[] inputBuffer, int start, int end, boolean bufferRecyclable)

Method Summary

Modifier and TypeMethod and Description
private final String
private final JsonToken
protected void
_closeInput()

Implements abstract tools.jackson.dataformat.smile.SmileParserBase._closeInput.

Abstract method for sub-classes to implement; to be called by close() implementation here.

private final void
private final String
_decodeLongUnicodeName(int[] quads, int byteLen, int quadLen, boolean addToSymbolTable)

private final void
private final String
protected final String
private final String
_decodeShortUnicodeName(int
Length between 1 and 64
len
)

Helper method used to decode short Unicode string, length for which actual length (in bytes) is known

protected final String
private final int
private final int
_decodeUtf8_3(int c1)

private final int
private final int

Returns:

Character value minus 0x10000; this so that caller can readily expand it to actual surrogates
_decodeUtf8_4
(int c)

private final JsonToken
private final String[]
_expandSeenNames(String[] oldShared)

Method called to try to expand shared name area to fit one more potentially shared String.

private final void
private final String
_findDecodedFixed12(int len, int q1, int q2)

Method for locating names longer than 12 bytes (in UTF-8)

private final String
_findDecodedFromSymbols(final 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 String
private String
private final void
private final void
protected byte[]
_finishBinary7BitLong(final int expLen)

private final byte[]
protected byte[]
_finishBinaryRawLong(final int expLen)

private final void
private final void
private final void
private final void
private final void
private final void
protected final void
protected final void
_finishToken()

Method called to finish parsing of a token so that token contents are retrievable

private final int
private final int
private final byte[]
private static int[]
_growArrayTo(int[] arr, int minSize)

private final String
protected final JsonToken
_handlePropertyName()

Method that handles initial token type recognition for token that has to be either PROPERTY_NAME or END_OBJECT.

private final JsonToken
protected final boolean
protected final void
protected final void
_loadToHaveAtLeast(int
Minimum number of bytes we absolutely need
minAvailable
)

Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessary.

private JsonToken
private final byte
private int
private final int
_nextNameFromSymbolsLong(PropertyNameMatcher matcher, int len, int q1, int q2)

Method for locating names longer than 8 bytes (in UTF-8)

private final int
private int
private static final int
_padLastQuad(int q, int bytes)

private static final int
_padQuadForNulls(int firstByte)

protected void
_parseNumericValue()

Implements abstract tools.jackson.dataformat.smile.SmileParserBase._parseNumericValue.

Method called to complete parsing of a numeric value: will throw StreamReadException if current token is not numeric.

protected boolean
_parseNumericValueIfNumber()

Implements abstract tools.jackson.dataformat.smile.SmileParserBase._parseNumericValueIfNumber.

Similar to _parseNumericValue(), but will not throw exception if the current token is not a numeric value.

private final byte[]
private void
_readBinaryEncoded(OutputStream out, int length, byte[] buffer)

protected final int
protected final int
protected void
_releaseBuffers2()

Implements abstract tools.jackson.dataformat.smile.SmileParserBase._releaseBuffers2.

Method called to release internal buffers owned by the base reader.

protected void
_reportIncompleteBinaryRead7Bit(int expLen, int actLen)

protected void
_reportIncompleteBinaryReadRaw(int expLen, int actLen)

protected void
protected void
_reportInvalidOther(int mask, int ptr)

protected void
protected void
protected void
protected final void
_reportInvalidUnsignedVInt(int firstCh, int lastCh)

protected String
_reportTruncatedUTF8InName(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected)

protected String
_reportTruncatedUTF8InString(int strLenBytes, int truncatedCharOffset, int firstUTFByteValue, int bytesExpected)

private JsonToken
protected void
_skip7BitBinary()

Helper method for skipping length-prefixed binary data section

protected void
_skipBytes(int len)

protected void
_skipIncomplete()

Method called to skip remainders of an incomplete token, when contents themselves will not be needed any more

protected final int

Returns:

Number of bytes that were missing, if any; 0 for successful read
_tryToLoadToHaveAtLeast
(int minAvailable)

Helper method that will try to load at least specified number bytes in input buffer, possible moving existing data around if necessary.

private void
createChildArrayContext(final int lineNr, final int colNr)

private void
createChildObjectContext(final int lineNr, final int colNr)

public void
finishToken()

Overrides tools.jackson.core.base.ParserMinimalBase.finishToken.

Method for forcing full read of current token, even if it might otherwise only be read if data is accessed via getString and similar methods.

public byte[]
getBinaryValue(Base64Variant b64variant)

Implements abstract tools.jackson.core.JsonParser.getBinaryValue.

Method that can be used to read (and consume -- results may not be accessible using other methods after the call) base64-encoded binary data included in the current textual JSON value.

public Object
getEmbeddedObject()

Overrides tools.jackson.core.base.ParserMinimalBase.getEmbeddedObject.

Accessor that can be called if (and only if) the current token is JsonToken#VALUE_EMBEDDED_OBJECT.

public String
getString()

Implements abstract tools.jackson.core.JsonParser.getString.

Method for accessing textual representation of the current event; if no current event (before first call to nextToken, or after encountering end-of-input), returns null.

public int
getString(Writer writer)

Overrides tools.jackson.core.base.ParserMinimalBase.getString.

Method to read the textual representation of the current token in chunks and pass it to the given Writer.

public char[]
getStringCharacters()

Implements abstract tools.jackson.core.JsonParser.getStringCharacters.

Method similar to getString(), but that will return underlying (unmodifiable) character array that contains textual value, instead of constructing a String object to contain this information.

public int
getStringLength()

Implements abstract tools.jackson.core.JsonParser.getStringLength.

Accessor used with getStringCharacters, to know length of String stored in returned buffer.

public int
getStringOffset()

Implements abstract tools.jackson.core.JsonParser.getStringOffset.

Accessor used with getStringCharacters, to know offset of the first text content character within buffer.

public String
getValueAsString()

Overrides tools.jackson.core.base.ParserMinimalBase.getValueAsString.

Method that will try to convert value of current token to a java.lang.String.

public String
getValueAsString(String defaultValue)

Overrides tools.jackson.core.base.ParserMinimalBase.getValueAsString.

Method that will try to convert value of current token to a java.lang.String.

protected boolean

Returns:

True if valid signature was found and handled; false if not
handleSignature
(boolean consumeFirstByte, boolean throwException)

Helper method called when it looks like input might contain the signature; and it is necessary to detect and handle signature to get configuration information it might have.

public boolean
hasStringCharacters()

Implements abstract tools.jackson.core.JsonParser.hasStringCharacters.

Method that can be used to determine whether calling of getStringCharacters would be the most efficient way to access String value for the event parser currently points to (compared to getString()).

public Boolean
nextBooleanValue()

Overrides tools.jackson.core.JsonParser.nextBooleanValue.

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_TRUE or JsonToken#VALUE_FALSE returns matching Boolean value; otherwise return null.

public int
nextIntValue(int defaultValue)

Overrides tools.jackson.core.JsonParser.nextIntValue.

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_NUMBER_INT returns 32-bit int value; otherwise returns specified default value It is functionally equivalent to:

  return (nextToken() == JsonToken.VALUE_NUMBER_INT) ?
public long
nextLongValue(long defaultValue)

Overrides tools.jackson.core.JsonParser.nextLongValue.

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_NUMBER_INT returns 64-bit long value; otherwise returns specified default value It is functionally equivalent to:

  return (nextToken() == JsonToken.VALUE_NUMBER_INT) ?
public String
nextName()

Overrides tools.jackson.core.base.ParserMinimalBase.nextName.

Method that fetches next token (as if calling nextToken) and verifies whether it is JsonToken#PROPERTY_NAME; if it is, returns same as currentName(), otherwise null.

public boolean
nextName(SerializableString str)

Overrides tools.jackson.core.base.ParserMinimalBase.nextName.

Method that fetches next token (as if calling nextToken) and verifies whether it is JsonToken#PROPERTY_NAME with specified name and returns result of that comparison.

public int
nextNameMatch(PropertyNameMatcher matcher)

Overrides tools.jackson.core.base.ParserMinimalBase.nextNameMatch.

Method that tries to match next token from stream as JsonToken#PROPERTY_NAME, and if so, further match it to one of pre-specified (field) names.

public String
nextStringValue()

Overrides tools.jackson.core.JsonParser.nextStringValue.

Method that fetches next token (as if calling nextToken) and if it is JsonToken#VALUE_STRING returns contained String value; otherwise returns null.

public JsonToken
nextToken()

Implements abstract tools.jackson.core.JsonParser.nextToken.

Main iteration method, which will advance stream enough to determine type of the next token, if any.

public int
readBinaryValue(Base64Variant b64variant, OutputStream out)

Overrides tools.jackson.core.JsonParser.readBinaryValue.

Similar to readBinaryValue(OutputStream) but allows explicitly specifying base64 variant to use.

public int
releaseBuffered(OutputStream out)

Overrides tools.jackson.core.JsonParser.releaseBuffered.

Method that can be called to push back any content that has been read but not consumed by the parser.

public Object
streamReadInputSource()

Implements abstract tools.jackson.core.JsonParser.streamReadInputSource.

Method that can be used to get access to object that is used to access input being parsed; this is usually either InputStream or Reader, depending on what parser was constructed with.

Inherited from tools.jackson.dataformat.smile.SmileParserBase:
_handleEOF_releaseBuffers_reportMismatchedEndMarker_sourceReferenceassignCurrentValuecloseconvertNumberToBigDecimalconvertNumberToBigIntegerconvertNumberToDoubleconvertNumberToFloatconvertNumberToIntconvertNumberToLongcurrentLocationcurrentNamecurrentTokenLocationcurrentValuegetBigIntegerValuegetDecimalValuegetDoubleValuegetFloatValuegetIntValuegetLongValuegetNumberTypegetNumberTypeFPgetNumberValuegetNumberValueExactisClosedisNaNmayContainRawBinarystreamReadCapabilitiesstreamReadContextversion