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 2017/05/03 13:56:34 UTC

[41/50] [abbrv] tinkerpop git commit: TINKERPOP-786 Added a bunch of javadoc

TINKERPOP-786 Added a bunch of javadoc


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

Branch: refs/heads/TINKERPOP-786
Commit: 2f17276e687d1391125de588fd9f717c4d23c781
Parents: 179fb52
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Apr 28 16:07:00 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed May 3 09:55:36 2017 -0400

----------------------------------------------------------------------
 .../process/traversal/dsl/GremlinDsl.java        | 19 +++++++++++++++++--
 .../traversal/dsl/GremlinDslProcessor.java       |  2 ++
 .../traversal/dsl/ProcessorException.java        |  2 ++
 3 files changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2f17276e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDsl.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDsl.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDsl.java
index d08736e..15b93d6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDsl.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDsl.java
@@ -27,7 +27,21 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * An annotation that specifies that an interface is meant to be used a DSL extension to a {@link GraphTraversal}.
+ * An annotation that specifies that an interface is meant to be used to produce Gremlin DSL. This annotation should
+ * be applied to an interface that extends {@link GraphTraversal}. This interface should be suffixed with
+ * {@code TraversalDsl}. The DSL classes will be generated to the package of the annotated class or the to the value
+ * specified in the {@link #packageName()} and will use the part of the interface name up to the suffix to generate
+ * the classes. Therefore, assuming an interface, annotated with {@code GremlinDsl}, called {@code SocialTraversalDsl},
+ * there will be three classes generated:
+ *
+ * <ul>
+ *     <li>{@code SocialTraversal} - an interface that is an extension to {@code SocialTraversalDsl}</li>
+ *     <li>{@code DefaultSocialTraversal} - an implementation of the {@code SocialTraversal}</li>
+ *     <li>{@code SocialTraversalSource} - an extension of {@link GraphTraversalSource} which spawns {@code DefaultSocialTraversal} instances</li>
+ * </ul>
+ *
+ * Together these generated classes provide all the infrastructure required to properly Gremlin traversals enhanced
+ * with domain specific steps.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
@@ -42,7 +56,8 @@ public @interface GremlinDsl {
     public String packageName() default "";
 
     /**
-     * Defines the optional canonical name of the {@link GraphTraversalSource} that this DSL should extend from.
+     * Defines the optional canonical name of the {@link GraphTraversalSource} that this DSL should extend from. If
+     * this value is not supplied the generated "source" will simply extend from {@link GraphTraversalSource}.
      */
     public String traversalSource() default "org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource";
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2f17276e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
index 6a09ef5..9e23410 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/GremlinDslProcessor.java
@@ -65,6 +65,8 @@ import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 /**
+ * A custom Java annotation processor for the {@link GremlinDsl} annotation that helps to generate DSLs classes.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 @SupportedAnnotationTypes("org.apache.tinkerpop.gremlin.process.traversal.dsl.GremlinDsl")

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2f17276e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/ProcessorException.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/ProcessorException.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/ProcessorException.java
index c84278e..3051890 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/ProcessorException.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/ProcessorException.java
@@ -21,6 +21,8 @@ package org.apache.tinkerpop.gremlin.process.traversal.dsl;
 import javax.lang.model.element.Element;
 
 /**
+ * Exception thrown by the {@link GremlinDslProcessor}.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public class ProcessorException extends Exception {