Top Description Fields Constructors Methods
tools.jackson.dataformat.protobuf

public final Class ProtobufReadContext

extends TokenStreamContext
Class Inheritance
Imports
tools.jackson.core.*, tools.jackson.core.io.CharTypes, .ContentReference, tools.jackson.dataformat.protobuf.schema.ProtobufField, .ProtobufMessage

Extension of tools.jackson.core.TokenStreamContext to support features needed to decode nested Protobuf messages.

Field Summary

Modifier and TypeField and Description
protected ProtobufReadContext
protected String
protected Object
protected int
_endOffset

Offset within input buffer where the message represented by this context (if message context) ends.

protected ProtobufField
_field

For array contexts: field that defines type of array values.

protected ProtobufMessage
_messageType

Type of current context.

protected final ProtobufReadContext
_parent

Parent context for this context; null for root context.

Inherited from tools.jackson.core.TokenStreamContext:
_index_nestingDepth_typeTYPE_ARRAYTYPE_OBJECTTYPE_ROOT

Constructor Summary

AccessConstructor and Description
public
ProtobufReadContext(ProtobufReadContext parent, ProtobufMessage messageType, int type, int endOffset)

Method Summary

Modifier and TypeMethod and Description
private void
_adjustEnd(int bytesConsumed)

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.

public void
assignCurrentValue(Object v)

Overrides tools.jackson.core.TokenStreamContext.assignCurrentValue.

Method to call to pass value to be returned via currentValue; typically called indirectly through JsonParser#assignCurrentValue or JsonGenerator#assignCurrentValue).

public ProtobufReadContext
public ProtobufReadContext
public ProtobufReadContext
public static ProtobufReadContext
public String
currentName()

Implements abstract tools.jackson.core.TokenStreamContext.currentName.

Method for accessing name associated with the current location.

public Object
currentValue()

Overrides tools.jackson.core.TokenStreamContext.currentValue.

Method for accessing currently active value being used by data-binding (as the source of streaming data to write, or destination of data being read), at this level in hierarchy.

public int
public ProtobufField
public ProtobufMessage
public ProtobufReadContext
getParent()

Implements abstract tools.jackson.core.TokenStreamContext.getParent.

Accessor for finding parent context of this context; will return null for root context.

protected void
reset(ProtobufMessage messageType, int type, int endOffset)

public void
public void
public TokenStreamLocation

Returns:

Location pointing to the point where the context start marker was found
startLocation
(ContentReference srcRef, long byteOffset)

public String
toString()

Overrides tools.jackson.core.TokenStreamContext.toString.

Overridden to provide developer readable "JsonPath" representation of the context.

Inherited from tools.jackson.core.TokenStreamContext:
getCurrentIndexgetEntryCountgetNestingDepthhasCurrentIndexhasCurrentNamehasPathSegmentinArrayinObjectinRootpathAsPointerpathAsPointerstartLocationtypeDesc

Field Detail

_childback to summary
protected ProtobufReadContext _child
_currentNameback to summary
protected String _currentName
_currentValueback to summary
protected Object _currentValue
Since
2.9
_endOffsetback to summary
protected int _endOffset

Offset within input buffer where the message represented by this context (if message context) ends.

_fieldback to summary
protected ProtobufField _field

For array contexts: field that defines type of array values.

_messageTypeback to summary
protected ProtobufMessage _messageType

Type of current context.

_parentback to summary
protected final ProtobufReadContext _parent

Parent context for this context; null for root context.

Constructor Detail

ProtobufReadContextback to summary
public ProtobufReadContext(ProtobufReadContext parent, ProtobufMessage messageType, int type, int endOffset)

Method Detail

_adjustEndback to summary
private void _adjustEnd(int bytesConsumed)
adjustEndback to summary
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.

assignCurrentValueback to summary
public void assignCurrentValue(Object v)

Overrides tools.jackson.core.TokenStreamContext.assignCurrentValue.

Doc from tools.jackson.core.TokenStreamContext.assignCurrentValue.

Method to call to pass value to be returned via currentValue; typically called indirectly through JsonParser#assignCurrentValue or JsonGenerator#assignCurrentValue).

Annotations
@Override
createChildArrayContextback to summary
public ProtobufReadContext createChildArrayContext(ProtobufField f)
createChildArrayContextback to summary
public ProtobufReadContext createChildArrayContext(ProtobufField f, int endOffset)
createChildObjectContextback to summary
public ProtobufReadContext createChildObjectContext(ProtobufMessage messageType, ProtobufField f, int endOffset)
createRootContextback to summary
public static ProtobufReadContext createRootContext()
currentNameback to summary
public String currentName()

Implements abstract tools.jackson.core.TokenStreamContext.currentName.

Doc from tools.jackson.core.TokenStreamContext.currentName.

Method for accessing name associated with the current location. Non-null for PROPERTY_NAME and value events that directly follow Property names; null for root level and array values.

Annotations
@Override
currentValueback to summary
public Object currentValue()

Overrides tools.jackson.core.TokenStreamContext.currentValue.

Doc from tools.jackson.core.TokenStreamContext.currentValue.

Method for accessing currently active value being used by data-binding (as the source of streaming data to write, or destination of data being read), at this level in hierarchy.

Note that "current value" is NOT populated (or used) by Streaming parser or generator; it is only used by higher-level data-binding functionality. The reason it is included here is that it can be stored and accessed hierarchically, and gets passed through data-binding.

Annotations
@Override
getEndOffsetback to summary
public int getEndOffset()
getFieldback to summary
public ProtobufField getField()
getMessageTypeback to summary
public ProtobufMessage getMessageType()
getParentback to summary
public ProtobufReadContext getParent()

Implements abstract tools.jackson.core.TokenStreamContext.getParent.

Doc from tools.jackson.core.TokenStreamContext.getParent.

Accessor for finding parent context of this context; will return null for root context.

Annotations
@Override
resetback to summary
protected void reset(ProtobufMessage messageType, int type, int endOffset)
setCurrentNameback to summary
public void setCurrentName(String name)
setMessageTypeback to summary
public void setMessageType(ProtobufMessage mt)
startLocationback to summary
public TokenStreamLocation startLocation(ContentReference srcRef, long byteOffset)
Returns:TokenStreamLocation

Location pointing to the point where the context start marker was found

toStringback to summary
public String toString()

Overrides tools.jackson.core.TokenStreamContext.toString.

Overridden to provide developer readable "JsonPath" representation of the context.

Annotations
@Override