Added javadoc to the Marshaller interface
git-svn-id: https://svn.apache.org/repos/asf/directmemory/lightning/trunk@1398079 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lightning-api/src/main/java/org/apache/directmemory/lightning/Marshaller.java b/lightning-api/src/main/java/org/apache/directmemory/lightning/Marshaller.java
index 03a56e8..5d20379 100644
--- a/lightning-api/src/main/java/org/apache/directmemory/lightning/Marshaller.java
+++ b/lightning-api/src/main/java/org/apache/directmemory/lightning/Marshaller.java
@@ -24,15 +24,43 @@
import org.apache.directmemory.lightning.metadata.PropertyDescriptor;
+/**
+ * Implementations of the Marshaller interface are used to serialize / deserialize object instances. Normally marshaller
+ * implementations are autogenerated by Lightning using the descriptions given {@link AbstractSerializerDefinition}s.
+ */
public interface Marshaller
{
+ /**
+ * Checks if a given type can be (de-) serialized with this marshaller implementation.
+ *
+ * @param type The type to check for being serializable by this marshaller
+ * @return true if the type can be (de-) serialized by this marshaller otherwise it returns false
+ */
boolean acceptType( Class<?> type );
+ /**
+ * Marshalls (serializes) an given object instance of a supported type, previously checked by acceptType.
+ *
+ * @param value Object instance to serialize
+ * @param propertyDescriptor The {@link PropertyDescriptor} of this object
+ * @param dataOutput The {@link DataOutput} implementation to write to
+ * @param serializationContext The {@link SerializationContext} used to serialize this object graph
+ * @throws IOException Throws {@link IOException} if any exception occurs while writing to the {@link DataOutput}
+ */
void marshall( Object value, PropertyDescriptor propertyDescriptor, DataOutput dataOutput,
SerializationContext serializationContext )
throws IOException;
+ /**
+ * Unmarshalls (deserializes) an object from the given {@link DataInput}.
+ *
+ * @param propertyDescriptor The {@link PropertyDescriptor} of this object
+ * @param dataInput The {@link DataInput} implementation to read from
+ * @param serializationContext The {@link SerializationContext} used to deserialize this object graph
+ * @return An object read from the given {@link DataInput}
+ * @throws IOException Throws {@link IOException} if any exception occurs while reading from the {@link DataInput}
+ */
<V> V unmarshall( PropertyDescriptor propertyDescriptor, DataInput dataInput,
SerializationContext serializationContext )
throws IOException;