public class ProtobufParser
extends com.fasterxml.jackson.core.base.ParserMinimalBase
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
_binaryValue
We will hold on to decoded binary data, for duration of
current event, so that multiple calls to
getBinaryValue(com.fasterxml.jackson.core.Base64Variant) will not need to decode data more
than once. |
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 com.fasterxml.jackson.core.util.ByteArrayBuilder |
_byteArrayBuilder
ByteArrayBuilder is needed if 'getBinaryValue' is called.
|
protected boolean |
_closed
Flag that indicates whether parser is closed or not.
|
protected int |
_currentEndOffset |
protected ProtobufField |
_currentField |
protected ProtobufMessage |
_currentMessage
The innermost Object type ("message" in proto lingo) we are handling.
|
protected long |
_currInputProcessed
Number of characters/bytes that were contained in previous blocks
(blocks that were already processed prior to the current buffer).
|
protected int |
_decodedLength
Length of the value that parser points to, for scalar values that use length
prefixes (Strings, binary data).
|
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 int |
_inputEnd
Index of character after last available one in the buffer.
|
protected int |
_inputPtr
Pointer to next available character in buffer
|
protected InputStream |
_inputStream
Input stream that can be used for reading more content, if one
in use.
|
protected com.fasterxml.jackson.core.io.IOContext |
_ioContext
I/O context for this reader.
|
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)
|
protected char[] |
_nameCopyBuffer
Temporary buffer that is needed if field name is accessed
using
getTextCharacters() method (instead of String
returning alternatives) |
protected int |
_nextTag |
protected BigDecimal |
_numberBigDecimal |
protected BigInteger |
_numberBigInt |
protected double |
_numberDouble |
protected float |
_numberFloat |
protected int |
_numberInt |
protected long |
_numberLong |
protected int |
_numTypesValid
Bitfield that indicates which numeric representations
have been calculated for the current type
|
protected com.fasterxml.jackson.core.ObjectCodec |
_objectCodec
Codec used for data binding when (if) requested.
|
protected ProtobufReadContext |
_parsingContext
Information about parser context, context in which
the next token is to be parsed (root, array, object).
|
protected ProtobufSchema |
_schema |
protected int |
_state
Current state of the parser.
|
protected 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)
|
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 |
_tokenInputCol
Column on input row that current token starts; 0-based (although
in the end it'll be converted to 1-based)
|
protected int |
_tokenInputRow
Input row on which current token starts, 1-based
|
protected long |
_tokenInputTotal
Total number of bytes/characters read before start of current token.
|
protected static com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> |
PROTOBUF_READ_CAPABILITIES |
_currToken, _lastClearedToken, BD_MAX_INT, BD_MAX_LONG, BD_MIN_INT, BD_MIN_LONG, BI_MAX_INT, BI_MAX_LONG, BI_MIN_INT, BI_MIN_LONG, CHAR_NULL, INT_0, INT_9, INT_APOS, INT_ASTERISK, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_e, INT_E, INT_HASH, INT_LBRACKET, INT_LCURLY, INT_LF, INT_MINUS, INT_PERIOD, INT_PLUS, INT_QUOTE, INT_RBRACKET, INT_RCURLY, INT_SLASH, INT_SPACE, INT_TAB, MAX_ERROR_TOKEN_LENGTH, MAX_INT_D, MAX_INT_L, MAX_LONG_D, MIN_INT_D, MIN_INT_L, MIN_LONG_D, NO_BYTES, NO_INTS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_FLOAT, NR_INT, NR_LONG, NR_UNKNOWN| Constructor and Description |
|---|
ProtobufParser(com.fasterxml.jackson.core.io.IOContext ctxt,
int parserFeatures,
com.fasterxml.jackson.core.ObjectCodec codec,
InputStream in,
byte[] inputBuffer,
int start,
int end,
boolean bufferRecyclable) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_checkNumericValue(int expType) |
protected void |
_closeInput() |
protected int |
_decode32Bits() |
protected long |
_decode64Bits() |
protected int |
_decodeVIntSlow() |
protected long |
_decodeVLongSlow() |
protected byte[] |
_finishBytes(int len) |
protected void |
_finishToken()
Method called to finish parsing of a token so that token contents
are retriable
|
protected com.fasterxml.jackson.core.util.ByteArrayBuilder |
_getByteArrayBuilder() |
protected void |
_handleEOF() |
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 necessary
|
protected static long |
_long(int i1,
int i2) |
protected void |
_releaseBuffers() |
protected void |
_skipBytes(int len) |
protected void |
_skipVInt() |
protected void |
_skipVIntSlow() |
protected int |
_slow32() |
protected long |
_slow64() |
boolean |
canUseSchema(com.fasterxml.jackson.core.FormatSchema schema) |
void |
close() |
protected void |
convertNumberToBigDecimal() |
protected void |
convertNumberToBigInteger() |
protected void |
convertNumberToDouble() |
protected void |
convertNumberToFloat() |
protected void |
convertNumberToInt() |
protected void |
convertNumberToLong() |
BigInteger |
getBigIntegerValue() |
byte[] |
getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant) |
com.fasterxml.jackson.core.ObjectCodec |
getCodec() |
com.fasterxml.jackson.core.JsonLocation |
getCurrentLocation()
Overridden since we do not really have character-based locations,
but we do have byte offset to specify.
|
String |
getCurrentName()
Method that can be called to get the name associated with
the current event.
|
BigDecimal |
getDecimalValue() |
double |
getDoubleValue() |
Object |
getEmbeddedObject() |
float |
getFloatValue() |
Object |
getInputSource() |
int |
getIntValue() |
long |
getLongValue() |
com.fasterxml.jackson.core.JsonParser.NumberType |
getNumberType() |
Number |
getNumberValue() |
Number |
getNumberValueExact() |
ProtobufReadContext |
getParsingContext() |
com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> |
getReadCapabilities() |
ProtobufSchema |
getSchema() |
String |
getText()
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. |
int |
getText(Writer writer) |
char[] |
getTextCharacters() |
int |
getTextLength() |
int |
getTextOffset() |
com.fasterxml.jackson.core.JsonLocation |
getTokenLocation()
Overridden since we do not really have character-based locations,
but we do have byte offset to specify.
|
String |
getValueAsString() |
String |
getValueAsString(String defaultValue) |
boolean |
hasTextCharacters() |
boolean |
isClosed() |
boolean |
isNaN() |
protected boolean |
loadMore() |
protected void |
loadMoreGuaranteed() |
String |
nextFieldName() |
boolean |
nextFieldName(com.fasterxml.jackson.core.SerializableString sstr) |
String |
nextTextValue() |
com.fasterxml.jackson.core.JsonToken |
nextToken() |
void |
overrideCurrentName(String name) |
int |
readBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant,
OutputStream out) |
int |
releaseBuffered(OutputStream out) |
void |
setCodec(com.fasterxml.jackson.core.ObjectCodec c) |
void |
setSchema(com.fasterxml.jackson.core.FormatSchema schema) |
void |
setSchema(ProtobufSchema schema) |
com.fasterxml.jackson.core.Version |
version() |
_ascii, _asciiBytes, _constructError, _decodeBase64, _getCharDesc, _hasTextualNull, _longIntegerDesc, _longNumberDesc, _reportError, _reportError, _reportError, _reportInputCoercion, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportInvalidEOFInValue, _reportMissingRootWS, _reportUnexpectedChar, _reportUnexpectedNumberChar, _throwInternal, _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_codec, _constructError, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _constructReadException, _reportUnsupportedOperation, assignCurrentValue, canParseAsync, canReadObjectId, canReadTypeId, configure, currentLocation, currentName, currentTokenLocation, currentValue, disable, enable, finishToken, getBinaryValue, getBooleanValue, getByteValue, getCurrentValue, getFeatureMask, getFormatFeatures, getNonBlockingInputFeeder, getObjectId, getShortValue, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, isEnabled, nextBooleanValue, nextIntValue, nextLongValue, overrideFormatFeatures, overrideStdFeatures, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, requiresCustomCodec, setCurrentValue, setFeatureMask, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnErrorprotected static final com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> PROTOBUF_READ_CAPABILITIES
protected com.fasterxml.jackson.core.ObjectCodec _objectCodec
protected ProtobufSchema _schema
protected final com.fasterxml.jackson.core.io.IOContext _ioContext
protected boolean _closed
close()) or when end-of-input is reached.protected int _inputPtr
protected int _inputEnd
protected long _currInputProcessed
protected long _tokenInputTotal
protected int _tokenInputRow
protected int _tokenInputCol
protected ProtobufReadContext _parsingContext
protected final com.fasterxml.jackson.core.util.TextBuffer _textBuffer
protected char[] _nameCopyBuffer
getTextCharacters() method (instead of String
returning alternatives)protected boolean _nameCopied
protected com.fasterxml.jackson.core.util.ByteArrayBuilder _byteArrayBuilder
protected byte[] _binaryValue
getBinaryValue(com.fasterxml.jackson.core.Base64Variant) will not need to decode data more
than once.protected InputStream _inputStream
protected byte[] _inputBuffer
protected boolean _bufferRecyclable
If it is not, it also means that parser can NOT modify underlying buffer.
protected ProtobufMessage _currentMessage
protected ProtobufField _currentField
protected boolean _tokenIncomplete
protected int _state
protected int _nextTag
protected int _decodedLength
protected int _currentEndOffset
protected int _numTypesValid
protected int _numberInt
protected float _numberFloat
protected long _numberLong
protected double _numberDouble
protected BigInteger _numberBigInt
protected BigDecimal _numberBigDecimal
public ProtobufParser(com.fasterxml.jackson.core.io.IOContext ctxt,
int parserFeatures,
com.fasterxml.jackson.core.ObjectCodec codec,
InputStream in,
byte[] inputBuffer,
int start,
int end,
boolean bufferRecyclable)
public void setSchema(ProtobufSchema schema)
public com.fasterxml.jackson.core.ObjectCodec getCodec()
getCodec in class com.fasterxml.jackson.core.JsonParserpublic void setCodec(com.fasterxml.jackson.core.ObjectCodec c)
setCodec in class com.fasterxml.jackson.core.JsonParserpublic com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> getReadCapabilities()
getReadCapabilities in class com.fasterxml.jackson.core.JsonParserpublic com.fasterxml.jackson.core.Version version()
version in interface com.fasterxml.jackson.core.Versionedversion in class com.fasterxml.jackson.core.JsonParserpublic int releaseBuffered(OutputStream out) throws IOException
releaseBuffered in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic Object getInputSource()
getInputSource in class com.fasterxml.jackson.core.JsonParserpublic com.fasterxml.jackson.core.JsonLocation getTokenLocation()
getTokenLocation in class com.fasterxml.jackson.core.JsonParserpublic com.fasterxml.jackson.core.JsonLocation getCurrentLocation()
getCurrentLocation in class com.fasterxml.jackson.core.JsonParserpublic String getCurrentName() throws IOException
getCurrentName in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic void overrideCurrentName(String name)
overrideCurrentName in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic boolean isClosed()
isClosed in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic ProtobufReadContext getParsingContext()
getParsingContext in class com.fasterxml.jackson.core.base.ParserMinimalBasepublic boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)
canUseSchema in class com.fasterxml.jackson.core.JsonParserpublic ProtobufSchema getSchema()
getSchema in class com.fasterxml.jackson.core.JsonParserpublic void setSchema(com.fasterxml.jackson.core.FormatSchema schema)
setSchema in class com.fasterxml.jackson.core.JsonParserpublic boolean hasTextCharacters()
hasTextCharacters in class com.fasterxml.jackson.core.base.ParserMinimalBaseprotected void _releaseBuffers()
throws IOException
IOExceptionpublic com.fasterxml.jackson.core.JsonToken nextToken()
throws IOException
nextToken in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic boolean nextFieldName(com.fasterxml.jackson.core.SerializableString sstr)
throws IOException
nextFieldName in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic String nextFieldName() throws IOException
nextFieldName in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic String nextTextValue() throws IOException
nextTextValue in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic String getText() throws IOException
nextToken(), or
after encountering end-of-input), returns null.
Method can be called for any event.getText in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic char[] getTextCharacters()
throws IOException
getTextCharacters in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic int getTextLength()
throws IOException
getTextLength in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic int getTextOffset()
throws IOException
getTextOffset in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic String getValueAsString() throws IOException
getValueAsString in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic String getValueAsString(String defaultValue) throws IOException
getValueAsString in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic int getText(Writer writer) throws IOException
getText in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant)
throws IOException
getBinaryValue in class com.fasterxml.jackson.core.base.ParserMinimalBaseIOExceptionpublic Object getEmbeddedObject() throws IOException
getEmbeddedObject in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic int readBinaryValue(com.fasterxml.jackson.core.Base64Variant b64variant,
OutputStream out)
throws IOException
readBinaryValue in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic boolean isNaN()
isNaN in class com.fasterxml.jackson.core.JsonParserpublic Number getNumberValue() throws IOException
getNumberValue in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic final Number getNumberValueExact() throws IOException
getNumberValueExact in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic com.fasterxml.jackson.core.JsonParser.NumberType getNumberType()
throws IOException
getNumberType in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic int getIntValue()
throws IOException
getIntValue in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic long getLongValue()
throws IOException
getLongValue in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic BigInteger getBigIntegerValue() throws IOException
getBigIntegerValue in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic float getFloatValue()
throws IOException
getFloatValue in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic double getDoubleValue()
throws IOException
getDoubleValue in class com.fasterxml.jackson.core.JsonParserIOExceptionpublic BigDecimal getDecimalValue() throws IOException
getDecimalValue in class com.fasterxml.jackson.core.JsonParserIOExceptionprotected void _checkNumericValue(int expType)
throws IOException
IOExceptionprotected void convertNumberToInt()
throws IOException
IOExceptionprotected void convertNumberToLong()
throws IOException
IOExceptionprotected void convertNumberToBigInteger()
throws IOException
IOExceptionprotected void convertNumberToFloat()
throws IOException
IOExceptionprotected void convertNumberToDouble()
throws IOException
IOExceptionprotected void convertNumberToBigDecimal()
throws IOException
IOExceptionprotected void _finishToken()
throws IOException
IOExceptionprotected byte[] _finishBytes(int len)
throws IOException
IOExceptionprotected final boolean loadMore()
throws IOException
IOExceptionprotected final void loadMoreGuaranteed()
throws IOException
IOExceptionprotected final void _loadToHaveAtLeast(int minAvailable)
throws IOException
IOExceptionprotected com.fasterxml.jackson.core.util.ByteArrayBuilder _getByteArrayBuilder()
protected void _closeInput()
throws IOException
IOExceptionprotected void _handleEOF()
throws com.fasterxml.jackson.core.JsonParseException
_handleEOF in class com.fasterxml.jackson.core.base.ParserMinimalBasecom.fasterxml.jackson.core.JsonParseExceptionprotected void _skipBytes(int len)
throws IOException
IOExceptionprotected void _skipVInt()
throws IOException
IOExceptionprotected void _skipVIntSlow()
throws IOException
IOExceptionprotected int _decodeVIntSlow()
throws IOException
IOExceptionprotected long _decodeVLongSlow()
throws IOException
IOExceptionprotected final int _decode32Bits()
throws IOException
IOExceptionprotected final int _slow32()
throws IOException
IOExceptionprotected final long _decode64Bits()
throws IOException
IOExceptionprotected final long _slow64()
throws IOException
IOExceptionprotected static final long _long(int i1,
int i2)
Copyright © 2022 FasterXML. All rights reserved.