final class MessageMarshallerDelegate<T> extends java.lang.Object implements BaseMarshallerDelegate<T>
| Modifier and Type | Field and Description |
|---|---|
private SerializationContextImpl |
ctx |
private FieldDescriptor[] |
fieldDescriptors |
private java.util.Map<java.lang.String,FieldDescriptor> |
fieldsByName |
private MessageMarshaller<T> |
marshaller |
private Descriptor |
messageDescriptor |
| Constructor and Description |
|---|
MessageMarshallerDelegate(SerializationContextImpl ctx,
MessageMarshaller<T> marshaller,
Descriptor messageDescriptor) |
| Modifier and Type | Method and Description |
|---|---|
FieldDescriptor |
getFieldByName(java.lang.String fieldName) |
FieldDescriptor[] |
getFieldDescriptors() |
MessageMarshaller<T> |
getMarshaller()
Gets the wrapped marshaller.
|
Descriptor |
getMessageDescriptor() |
void |
marshall(FieldDescriptor fieldDescriptor,
T message,
ProtoStreamWriterImpl writer,
RawProtoStreamWriter out)
Marshalls an object.
|
T |
unmarshall(FieldDescriptor fieldDescriptor,
ProtoStreamReaderImpl reader,
RawProtoStreamReader in)
Unmarshalls an object.
|
private final SerializationContextImpl ctx
private final MessageMarshaller<T> marshaller
private final Descriptor messageDescriptor
private final FieldDescriptor[] fieldDescriptors
private final java.util.Map<java.lang.String,FieldDescriptor> fieldsByName
public MessageMarshallerDelegate(SerializationContextImpl ctx, MessageMarshaller<T> marshaller, Descriptor messageDescriptor)
public MessageMarshaller<T> getMarshaller()
BaseMarshallerDelegategetMarshaller in interface BaseMarshallerDelegate<T>public Descriptor getMessageDescriptor()
public FieldDescriptor[] getFieldDescriptors()
public FieldDescriptor getFieldByName(java.lang.String fieldName) throws java.io.IOException
java.io.IOExceptionpublic void marshall(FieldDescriptor fieldDescriptor, T message, ProtoStreamWriterImpl writer, RawProtoStreamWriter out) throws java.io.IOException
BaseMarshallerDelegatemarshall in interface BaseMarshallerDelegate<T>fieldDescriptor - the FieldDescriptor of the field being marshalled or null if this is a
top-level objectmessage - the value being marshalled (cannot be null)writer - the ProtoStreamWriterImpl instance to use/re-use, if the specific marshaller type
needs one; can be null in which case the delegate has to create a ProtoStreamWriterImpl instance itself based on the out parameterout - the Protobuf tag output stream (cannot be null)java.io.IOException - if marshalling fails for some reasonpublic T unmarshall(FieldDescriptor fieldDescriptor, ProtoStreamReaderImpl reader, RawProtoStreamReader in) throws java.io.IOException
BaseMarshallerDelegateunmarshall in interface BaseMarshallerDelegate<T>fieldDescriptor - the FieldDescriptor of the field being unmarshalled or null if this is a
top-level objectreader - the ProtoStreamReaderImpl instance to use/re-use, if the specific marshaller type
needs one; can be null in which case the delegate has to create a ProtoStreamReaderImpl instance itself based on the in parameterin - the Protobuf tag input stream (cannot be null)java.io.IOException - if unmarshalling fails for some reason