Class MessageContext<E extends MessageContext<E>>

java.lang.Object
org.infinispan.protostream.MessageContext<E>
Direct Known Subclasses:
ProtoStreamReaderImpl.ReadMessageContext, ProtoStreamWriterImpl.WriteMessageContext

public class MessageContext<E extends MessageContext<E>> extends Object
A nested message processing context.
Since:
1.0
  • Field Details

    • parentContext

      private final E extends MessageContext<E> parentContext
      The context of the outer message or null if this is a top level message.
    • fieldDescriptor

      private final FieldDescriptor fieldDescriptor
      If this is a nested context this is the outer field being processed. This is null for the root context.
    • fieldPath

      private String fieldPath
      Dot separated path of the field.
    • messageDescriptor

      private final Descriptor messageDescriptor
      The descriptor of the current message.
    • seenFields

      private final BitSet seenFields
    • maxSeenFieldNumber

      private int maxSeenFieldNumber
  • Constructor Details

  • Method Details

    • getParentContext

      public E getParentContext()
    • getField

      public FieldDescriptor getField()
      Gets the nested field.
      Returns:
      the descriptor of the nested field or null if this is the root context
    • getFieldPath

      public String getFieldPath()
      Gets the full path of the nested field.
      Returns:
      the full path of the nested field or null if this is the root context
    • getMessageDescriptor

      public Descriptor getMessageDescriptor()
    • getFieldByName

      public FieldDescriptor getFieldByName(String fieldName) throws IOException
      Throws:
      IOException
    • isFieldMarked

      public boolean isFieldMarked(int fieldNumber)
    • markField

      public boolean markField(int fieldNumber)
      Mark a field as seen.
      Parameters:
      fieldNumber - the field number
      Returns:
      true if it was added, false if it was already there
    • getMaxSeenFieldNumber

      public int getMaxSeenFieldNumber()