camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/4] camel git commit: Component docs
Date Thu, 18 Jun 2015 11:57:44 GMT
Component docs


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

Branch: refs/heads/master
Commit: d38ffcf36504ba1186c851455410fb021019a74d
Parents: f69cfbc
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Jun 18 13:52:03 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jun 18 13:52:03 2015 +0200

----------------------------------------------------------------------
 .../apache/camel/tools/apt/EndpointAnnotationProcessor.java   | 5 ++++-
 .../src/main/java/org/apache/camel/spi/Metadata.java          | 7 +++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d38ffcf3/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
index 2757a53..74ea3f7 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EndpointAnnotationProcessor.java
@@ -480,7 +480,10 @@ public class EndpointAnnotationProcessor extends AbstractAnnotationProcessor
{
                 String defaultValueNote = null;
 
                 String docComment = findJavaDoc(elementUtils, method, fieldName, name, classElement,
false);
-                if (docComment == null) {
+                if (isNullOrEmpty(docComment)) {
+                    docComment = metadata != null ? metadata.description() : null;
+                }
+                if (isNullOrEmpty(docComment)) {
                     // apt cannot grab javadoc from camel-core, only from annotations
                     if ("setHeaderFilterStrategy".equals(methodName)) {
                         docComment = HEADER_FILTER_STRATEGY_JAVADOC;

http://git-wip-us.apache.org/repos/asf/camel/blob/d38ffcf3/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java
----------------------------------------------------------------------
diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java
index 99477f2..825c8b3 100644
--- a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java
+++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/Metadata.java
@@ -54,4 +54,11 @@ public @interface Metadata {
      */
     String title() default "";
 
+    /**
+     * Returns a description of this entity.
+     * <p/>
+     * This is used for documentation and tooling only.
+     */
+    String description() default "";
+
 }


Mime
View raw message