camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: Camel eip model for routes should include that it has an array of route elements
Date Tue, 29 Sep 2015 12:12:35 GMT
Repository: camel
Updated Branches:
  refs/heads/master 3e66099a3 -> a4b3ef7d7


Camel eip model for routes should include that it has an array of route elements


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

Branch: refs/heads/master
Commit: a4b3ef7d7bfd00e04cf05ce6be7091dd8e386555
Parents: 3e66099
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Sep 29 14:14:19 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Sep 29 14:14:19 2015 +0200

----------------------------------------------------------------------
 .../camel/tools/apt/EipAnnotationProcessor.java | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a4b3ef7d/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
index c51c6ea..1262842 100644
--- a/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
+++ b/tooling/apt/src/main/java/org/apache/camel/tools/apt/EipAnnotationProcessor.java
@@ -271,6 +271,9 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor
{
                 XmlElementRef elementRef = fieldElement.getAnnotation(XmlElementRef.class);
                 if (elementRef != null) {
 
+                    // special for routes
+                    processRoutes(roundEnv, originalClassType, elementRef, fieldElement,
fieldName, eipOptions, prefix);
+
                     // special for outputs
                     processOutputs(roundEnv, originalClassType, elementRef, fieldElement,
fieldName, eipOptions, prefix);
 
@@ -612,6 +615,24 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor
{
     }
 
     /**
+     * Special for processing an @XmlElementRef routes field
+     */
+    private void processRoutes(RoundEnvironment roundEnv, TypeElement originalClassType,
XmlElementRef elementRef,
+                               VariableElement fieldElement, String fieldName, Set<EipOption>
eipOptions, String prefix) {
+        if ("routes".equals(fieldName)) {
+
+            TypeMirror fieldType = fieldElement.asType();
+            String fieldTypeName = fieldType.toString();
+
+            Set<String> oneOfTypes = new TreeSet<String>();
+            oneOfTypes.add("route");
+
+            EipOption ep = new EipOption("routes", "element", fieldTypeName, false, "", "Contains
the Camel routes", false, false, null, true, oneOfTypes);
+            eipOptions.add(ep);
+        }
+    }
+
+    /**
      * Special for processing an @XmlElementRef outputs field
      */
     private void processOutputs(RoundEnvironment roundEnv, TypeElement originalClassType,
XmlElementRef elementRef,


Mime
View raw message