Some more javadoc
git-svn-id: https://svn.apache.org/repos/asf/directmemory/lightning/trunk@1398124 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lightning-core/src/main/java/org/apache/directmemory/lightning/MarshallerContext.java b/lightning-core/src/main/java/org/apache/directmemory/lightning/MarshallerContext.java
index 39944dc..b024d6b 100644
--- a/lightning-core/src/main/java/org/apache/directmemory/lightning/MarshallerContext.java
+++ b/lightning-core/src/main/java/org/apache/directmemory/lightning/MarshallerContext.java
@@ -20,11 +20,26 @@
import java.lang.reflect.Type;
+/**
+ * The MarshallerContext is used to collect all {@link Marshaller}s by type.
+ */
public interface MarshallerContext
{
+ /**
+ * Returns a {@link Marshaller} by given type.
+ *
+ * @param type The type to search the {@link Marshaller} for
+ * @return The {@link Marshaller} implementation
+ */
Marshaller getMarshaller( Type type );
+ /**
+ * Binds a new {@link Marshaller} implementation to the given type
+ *
+ * @param type The type to bind the {@link Marshaller} to
+ * @param marshaller The {@link Marshaller} implementation to bind to the given type
+ */
void bindMarshaller( Type type, Marshaller marshaller );
}
diff --git a/lightning-core/src/main/java/org/apache/directmemory/lightning/MarshallerStrategy.java b/lightning-core/src/main/java/org/apache/directmemory/lightning/MarshallerStrategy.java
index 79dfd75..de7985b 100644
--- a/lightning-core/src/main/java/org/apache/directmemory/lightning/MarshallerStrategy.java
+++ b/lightning-core/src/main/java/org/apache/directmemory/lightning/MarshallerStrategy.java
@@ -18,13 +18,36 @@
*/
package org.apache.directmemory.lightning;
+import java.io.Serializable;
import java.lang.reflect.Type;
+/**
+ * The MarshallerStrategy is used to find a marshaller for a given type in a {@link MarshallerContext}. This class is
+ * used internally for finding generated {@link Marshaller} implementations.
+ */
public interface MarshallerStrategy
{
+ /**
+ * Returns a {@link Marshaller} implementation found in the given {@link MarshallerContext} for type.
+ *
+ * @param type The type to search with
+ * @param marshallerContext The {@link MarshallerContext} to search in
+ * @return The {@link Marshaller} implementation
+ */
Marshaller getMarshaller( Type type, MarshallerContext marshallerContext );
+ /**
+ * Returns a {@link Marshaller} implementation found in the given {@link MarshallerContext} for type. If
+ * baseMarshallerOnly is set no {@link Serializable} {@link Marshaller} will be used in hope to find a more suitable
+ * one.
+ *
+ * @param type The type to search with
+ * @param marshallerContext The {@link MarshallerContext} to search in
+ * @param baseMarshallersOnly If set to false the {@link Serializable} {@link Marshaller} implementation will be
+ * skipped when searching for a suitable one
+ * @return The {@link Marshaller} implementation
+ */
Marshaller getMarshaller( Type type, MarshallerContext marshallerContext, boolean baseMarshallersOnly );
}
diff --git a/lightning-core/src/main/java/org/apache/directmemory/lightning/SerializationStrategy.java b/lightning-core/src/main/java/org/apache/directmemory/lightning/SerializationStrategy.java
index 6fc9b20..c3ab63e 100644
--- a/lightning-core/src/main/java/org/apache/directmemory/lightning/SerializationStrategy.java
+++ b/lightning-core/src/main/java/org/apache/directmemory/lightning/SerializationStrategy.java
@@ -18,6 +18,9 @@
*/
package org.apache.directmemory.lightning;
+/**
+ * The SerializationStrategy defines how Lightning will (de-) serialize objects from / into the datastream.
+ */
public enum SerializationStrategy
{