camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: Camel eip model for rests should include that it has an array of rest elements
Date Tue, 29 Sep 2015 12:21:34 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x c7ae2a545 -> 32b1b8263
  refs/heads/master a4b3ef7d7 -> b412ba0b7


Camel eip model for rests should include that it has an array of rest elements


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

Branch: refs/heads/master
Commit: b412ba0b7b08234100326a5113db613e030dae4f
Parents: a4b3ef7
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Sep 29 14:22:27 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Sep 29 14:22:27 2015 +0200

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


http://git-wip-us.apache.org/repos/asf/camel/blob/b412ba0b/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 1262842..c02c7c5 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
@@ -274,6 +274,9 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor
{
                     // special for routes
                     processRoutes(roundEnv, originalClassType, elementRef, fieldElement,
fieldName, eipOptions, prefix);
 
+                    // special for rests
+                    processRests(roundEnv, originalClassType, elementRef, fieldElement, fieldName,
eipOptions, prefix);
+
                     // special for outputs
                     processOutputs(roundEnv, originalClassType, elementRef, fieldElement,
fieldName, eipOptions, prefix);
 
@@ -633,6 +636,24 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor
{
     }
 
     /**
+     * Special for processing an @XmlElementRef rests field
+     */
+    private void processRests(RoundEnvironment roundEnv, TypeElement originalClassType, XmlElementRef
elementRef,
+                               VariableElement fieldElement, String fieldName, Set<EipOption>
eipOptions, String prefix) {
+        if ("rests".equals(fieldName)) {
+
+            TypeMirror fieldType = fieldElement.asType();
+            String fieldTypeName = fieldType.toString();
+
+            Set<String> oneOfTypes = new TreeSet<String>();
+            oneOfTypes.add("rest");
+
+            EipOption ep = new EipOption("rests", "element", fieldTypeName, false, "", "Contains
the rest services defined using the rest-dsl", 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