Class ProtobufReadContext
java.lang.Object
tools.jackson.core.TokenStreamContext
tools.jackson.dataformat.protobuf.ProtobufReadContext
public final class ProtobufReadContext
extends tools.jackson.core.TokenStreamContext
Extension of
TokenStreamContext
to support features needed to decode nested Protobuf messages.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ProtobufReadContextprotected Stringprotected Objectprotected intOffset within input buffer where the message represented by this context (if message context) ends.protected ProtobufFieldFor array contexts: field that defines type of array values.protected ProtobufMessageType of current context.protected final ProtobufReadContextParent context for this context; null for root context.Fields inherited from class tools.jackson.core.TokenStreamContext
_index, _nestingDepth, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT -
Constructor Summary
ConstructorsConstructorDescriptionProtobufReadContext(ProtobufReadContext parent, ProtobufMessage messageType, int type, int endOffset) -
Method Summary
Modifier and TypeMethodDescriptionintadjustEnd(int bytesConsumed) Method called when loading more input, or moving existing data; this requires adjusting relative end offset as well, except for root context.voidcreateChildArrayContext(ProtobufField f, int endOffset) createChildObjectContext(ProtobufMessage messageType, ProtobufField f, int endOffset) static ProtobufReadContextintgetField()protected voidreset(ProtobufMessage messageType, int type, int endOffset) voidsetCurrentName(String name) voidtools.jackson.core.TokenStreamLocationstartLocation(tools.jackson.core.io.ContentReference srcRef, long byteOffset) toString()Overridden to provide developer readable "JsonPath" representation of the context.Methods inherited from class tools.jackson.core.TokenStreamContext
getCurrentIndex, getEntryCount, getNestingDepth, hasCurrentIndex, hasCurrentName, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, startLocation, typeDesc
-
Field Details
-
_parent
Parent context for this context; null for root context. -
_messageType
Type of current context. -
_field
For array contexts: field that defines type of array values. -
_currentName
-
_currentValue
- Since:
- 2.9
-
_endOffset
protected int _endOffsetOffset within input buffer where the message represented by this context (if message context) ends. -
_child
-
-
Constructor Details
-
ProtobufReadContext
public ProtobufReadContext(ProtobufReadContext parent, ProtobufMessage messageType, int type, int endOffset)
-
-
Method Details
-
reset
-
currentValue
- Overrides:
currentValuein classtools.jackson.core.TokenStreamContext
-
assignCurrentValue
- Overrides:
assignCurrentValuein classtools.jackson.core.TokenStreamContext
-
createRootContext
-
createChildArrayContext
-
createChildArrayContext
-
createChildObjectContext
public ProtobufReadContext createChildObjectContext(ProtobufMessage messageType, ProtobufField f, int endOffset) -
currentName
- Specified by:
currentNamein classtools.jackson.core.TokenStreamContext
-
getParent
- Specified by:
getParentin classtools.jackson.core.TokenStreamContext
-
adjustEnd
public int adjustEnd(int bytesConsumed) Method called when loading more input, or moving existing data; this requires adjusting relative end offset as well, except for root context. -
getEndOffset
public int getEndOffset() -
getMessageType
-
getField
-
setMessageType
-
startLocation
public tools.jackson.core.TokenStreamLocation startLocation(tools.jackson.core.io.ContentReference srcRef, long byteOffset) - Returns:
- Location pointing to the point where the context start marker was found
-
setCurrentName
-
toString
Overridden to provide developer readable "JsonPath" representation of the context.- Overrides:
toStringin classtools.jackson.core.TokenStreamContext
-