Package org.infinispan.protostream
Class MessageContext<E extends MessageContext<E>>
java.lang.Object
org.infinispan.protostream.MessageContext<E>
- Direct Known Subclasses:
ProtoStreamReaderImpl.ReadMessageContext,ProtoStreamWriterImpl.WriteMessageContext
A nested message processing context.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FieldDescriptorIf this is a nested context this is the outer field being processed.private StringDot separated path of the field.private intprivate final DescriptorThe descriptor of the current message.private final EThe context of the outer message or null if this is a top level message.private final BitSet -
Constructor Summary
ConstructorsConstructorDescriptionMessageContext(E parentContext, FieldDescriptor fieldDescriptor, Descriptor messageDescriptor) -
Method Summary
Modifier and TypeMethodDescriptiongetField()Gets the nested field.getFieldByName(String fieldName) Gets the full path of the nested field.intbooleanisFieldMarked(int fieldNumber) booleanmarkField(int fieldNumber) Mark a field as seen.
-
Field Details
-
parentContext
The context of the outer message or null if this is a top level message. -
fieldDescriptor
If this is a nested context this is the outer field being processed. This is null for the root context. -
fieldPath
Dot separated path of the field. -
messageDescriptor
The descriptor of the current message. -
seenFields
-
maxSeenFieldNumber
private int maxSeenFieldNumber
-
-
Constructor Details
-
MessageContext
public MessageContext(E parentContext, FieldDescriptor fieldDescriptor, Descriptor messageDescriptor)
-
-
Method Details
-
getParentContext
-
getField
Gets the nested field.- Returns:
- the descriptor of the nested field or
nullif this is the root context
-
getFieldPath
Gets the full path of the nested field.- Returns:
- the full path of the nested field or
nullif this is the root context
-
getMessageDescriptor
-
getFieldByName
- 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()
-