Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.protostream.impl;
 
 
The marshallers (descendants of org.infinispan.protostream.BaseMarshaller) do not have a uniform interface, so an extra layer of indirection is used to provide uniformity. A delegate object wraps the real marshaller and delegates actual marshalling to it, taking into account the specific interface differences for each kind of marshaller (EnumMarshaller, MessageMarshaller, RawProtobufMarshaller).

Author(s):
anistor@redhat.com
Since:
1.0
public interface BaseMarshallerDelegate<T> {

   
Gets the wrapped marshaller.

Returns:
the wrapped marshaller instance
   BaseMarshaller<T> getMarshaller();

   
Marshalls an object.

Parameters:
fieldDescriptor the FieldDescriptor of the field being marshalled or null if this is a top-level object
value 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 parameter
out the Protobuf tag output stream (cannot be null)
Throws:
java.io.IOException if marshalling fails for some reason
   void marshall(FieldDescriptor fieldDescriptor, T valueProtoStreamWriterImpl writerRawProtoStreamWriter outthrows IOException;

   
Unmarshalls an object.

Parameters:
fieldDescriptor the FieldDescriptor of the field being unmarshalled or null if this is a top-level object
reader the org.infinispan.protostream.impl.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 org.infinispan.protostream.impl.ProtoStreamReaderImpl instance itself based on the in parameter
in the Protobuf tag input stream (cannot be null)
Throws:
java.io.IOException if unmarshalling fails for some reason
   T unmarshall(FieldDescriptor fieldDescriptorProtoStreamReaderImpl readerRawProtoStreamReader inthrows IOException;
New to GrepCode? Check out our FAQ X