You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/05/01 17:53:01 UTC

[30/50] [abbrv] incubator-tinkerpop git commit: Update javadoc for some of the GraphSON.

Update javadoc for some of the GraphSON.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/e6e4e6fd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/e6e4e6fd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/e6e4e6fd

Branch: refs/heads/variables
Commit: e6e4e6fdd2d34d36d407c1f691bad401f72dd396
Parents: 0fa302a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Apr 30 13:23:19 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Apr 30 13:23:19 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/io/graphson/GraphSONIo.java       |  3 +++
 .../gremlin/structure/io/graphson/GraphSONMapper.java   | 12 +++++++++++-
 .../gremlin/structure/io/graphson/GraphSONModule.java   | 10 +++++++++-
 3 files changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6e4e6fd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java
index 480ae9e..3aabaf2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONIo.java
@@ -29,6 +29,9 @@ import java.io.InputStream;
 import java.io.OutputStream;
 
 /**
+ * Constructs Gryo IO implementations given a {@link Graph} and {@link IoRegistry}. Implementers of the {@link Graph}
+ * interfaces should see the {@link GraphSONMapper} for information on the expectations for the {@link IoRegistry}.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class GraphSONIo implements Io<GraphSONReader.Builder, GraphSONWriter.Builder, GraphSONMapper.Builder> {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6e4e6fd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java
index a3dab2c..03af2d4 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONMapper.java
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.databind.module.SimpleModule;
 import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;
+import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.io.IoRegistry;
 import org.apache.tinkerpop.gremlin.structure.io.Mapper;
 import org.javatuples.Pair;
@@ -32,8 +33,17 @@ import java.util.List;
 
 /**
  * An extension to the standard Jackson {@code ObjectMapper} which automatically registers the standard
- * {@link GraphSONModule} for serializing {@link org.apache.tinkerpop.gremlin.structure.Graph} elements.  This class
+ * {@link GraphSONModule} for serializing {@link Graph} elements.  This class
  * can be used for generalized JSON serialization tasks that require meeting GraphSON standards.
+ * <p/>
+ * {@link Graph} implementations providing an {@link IoRegistry} should register their {@code SimpleModule}
+ * implementations to it as follows:
+ * <pre>
+ * {@code
+ * IoRegistry registry = new IoRegistry();
+ * registry.register(GraphSONIo.class, null, new MySimpleModule());
+ * }
+ * </pre>
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6e4e6fd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
index 39fe40e..1ee5137 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
@@ -28,12 +28,20 @@ import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.structure.util.star.StarGraphGraphSONSerializer;
 
 /**
- * The set of serializers that handle the core graph interfaces.
+ * The set of serializers that handle the core graph interfaces.  These serializers support normalization which
+ * ensures that generated GraphSON will be compatible with line-based versioning tools. This setting comes with
+ * some overhead, with respect to key sorting and other in-memory operations.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class GraphSONModule extends SimpleModule {
 
+    /**
+     * Constructs a new object.
+     *
+     * @param normalize when set to true, keys and objects are ordered to ensure that they are the occur in
+     *                  the same order
+     */
     public GraphSONModule(final boolean normalize) {
         super("graphson");
         addSerializer(Edge.class, new GraphSONSerializers.EdgeJacksonSerializer(normalize));