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 Details

    • _parent

      protected final ProtobufReadContext _parent
      Parent context for this context; null for root context.
    • _messageType

      protected ProtobufMessage _messageType
      Type of current context.
    • _field

      protected ProtobufField _field
      For array contexts: field that defines type of array values.
    • _currentName

      protected String _currentName
    • _currentValue

      protected Object _currentValue
      Since:
      2.9
    • _endOffset

      protected int _endOffset
      Offset within input buffer where the message represented by this context (if message context) ends.
    • _child

      protected ProtobufReadContext _child
  • Constructor Details

  • Method Details

    • reset

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

      public Object currentValue()
      Overrides:
      currentValue in class tools.jackson.core.TokenStreamContext
    • assignCurrentValue

      public void assignCurrentValue(Object v)
      Overrides:
      assignCurrentValue in class tools.jackson.core.TokenStreamContext
    • createRootContext

      public static ProtobufReadContext createRootContext()
    • createChildArrayContext

      public ProtobufReadContext createChildArrayContext(ProtobufField f)
    • createChildArrayContext

      public ProtobufReadContext createChildArrayContext(ProtobufField f, int endOffset)
    • createChildObjectContext

      public ProtobufReadContext createChildObjectContext(ProtobufMessage messageType, ProtobufField f, int endOffset)
    • currentName

      public String currentName()
      Specified by:
      currentName in class tools.jackson.core.TokenStreamContext
    • getParent

      public ProtobufReadContext getParent()
      Specified by:
      getParent in class tools.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

      public ProtobufMessage getMessageType()
    • getField

      public ProtobufField getField()
    • setMessageType

      public void setMessageType(ProtobufMessage mt)
    • 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

      public void setCurrentName(String name)
    • toString

      public String toString()
      Overridden to provide developer readable "JsonPath" representation of the context.
      Overrides:
      toString in class tools.jackson.core.TokenStreamContext