You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/12/19 09:40:23 UTC

[1/2] camel git commit: CAMEL-10592: Component title for secured alternative should indicate that in the title.

Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x 74fd15101 -> 7b4b77a11
  refs/heads/master f0caeee20 -> 4a60c5c30


CAMEL-10592: Component title for secured alternative should indicate that in the title.


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

Branch: refs/heads/master
Commit: 4a60c5c30c0782b542839a83c048c9fa2d0bcf64
Parents: f0caeee
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Dec 19 10:39:43 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Dec 19 10:39:43 2016 +0100

----------------------------------------------------------------------
 .../tools/apt/EndpointAnnotationProcessor.java  | 22 +++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4a60c5c3/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 0b60421..446aa61 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
@@ -112,7 +112,14 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                 for (int i = 0; i < schemes.length; i++) {
                     final String alias = schemes[i];
                     final String extendsAlias = extendsSchemes != null ? (i < extendsSchemes.length ? extendsSchemes[i] : extendsSchemes[0]) : null;
-                    final String aliasTitle = i < titles.length ? titles[i] : titles[0];
+                    String aTitle = i < titles.length ? titles[i] : titles[0];
+
+                    // some components offer a secure alternative which we need to amend the title accordingly
+                    if (secureAlias(schemes[0], alias)) {
+                        aTitle += " (Secure)";
+                    }
+                    final String aliasTitle = aTitle;
+
                     // write html documentation
                     String name = canonicalClassName(classElement.getQualifiedName().toString());
                     String packageName = name.substring(0, name.lastIndexOf("."));
@@ -866,6 +873,19 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
         return answer;
     }
 
+    private static boolean secureAlias(String scheme, String alias) {
+        if (scheme.equals(alias)) {
+            return false;
+        }
+
+        // if alias is like scheme but with ending s its secured
+        if ((scheme + "s").equals(alias)) {
+            return true;
+        }
+
+        return false;
+    }
+
     // CHECKSTYLE:ON
 
 }


[2/2] camel git commit: CAMEL-10592: Component title for secured alternative should indicate that in the title.

Posted by da...@apache.org.
CAMEL-10592: Component title for secured alternative should indicate that in the title.


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

Branch: refs/heads/camel-2.18.x
Commit: 7b4b77a11ecfff1f507843e576624f0b97d65fd9
Parents: 74fd151
Author: Claus Ibsen <da...@apache.org>
Authored: Mon Dec 19 10:39:43 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Mon Dec 19 10:40:15 2016 +0100

----------------------------------------------------------------------
 .../tools/apt/EndpointAnnotationProcessor.java  | 22 +++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7b4b77a1/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 0b60421..446aa61 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
@@ -112,7 +112,14 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
                 for (int i = 0; i < schemes.length; i++) {
                     final String alias = schemes[i];
                     final String extendsAlias = extendsSchemes != null ? (i < extendsSchemes.length ? extendsSchemes[i] : extendsSchemes[0]) : null;
-                    final String aliasTitle = i < titles.length ? titles[i] : titles[0];
+                    String aTitle = i < titles.length ? titles[i] : titles[0];
+
+                    // some components offer a secure alternative which we need to amend the title accordingly
+                    if (secureAlias(schemes[0], alias)) {
+                        aTitle += " (Secure)";
+                    }
+                    final String aliasTitle = aTitle;
+
                     // write html documentation
                     String name = canonicalClassName(classElement.getQualifiedName().toString());
                     String packageName = name.substring(0, name.lastIndexOf("."));
@@ -866,6 +873,19 @@ public class EndpointAnnotationProcessor extends AbstractProcessor {
         return answer;
     }
 
+    private static boolean secureAlias(String scheme, String alias) {
+        if (scheme.equals(alias)) {
+            return false;
+        }
+
+        // if alias is like scheme but with ending s its secured
+        if ((scheme + "s").equals(alias)) {
+            return true;
+        }
+
+        return false;
+    }
+
     // CHECKSTYLE:ON
 
 }