Repository: camel Updated Branches: refs/heads/camel-2.15.x aca7225f8 -> 84281b415 refs/heads/camel-2.16.x ec4919bcf -> 0ec9813dc refs/heads/master e33d97b62 -> 54c0d63a6
Fixed camel model json schema to include missing namespace aware languages. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/54c0d63a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/54c0d63a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/54c0d63a Branch: refs/heads/master Commit: 54c0d63a6ac4758b3d24eb8623427dbe4a420c01 Parents: e33d97b Author: Claus Ibsen <[email protected]> Authored: Thu Oct 15 13:53:08 2015 +0200 Committer: Claus Ibsen <[email protected]> Committed: Thu Oct 15 13:53:08 2015 +0200 ---------------------------------------------------------------------- .../camel/tools/apt/EipAnnotationProcessor.java | 55 +++++++++++--------- 1 file changed, 31 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/54c0d63a/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 95f7566..e7e6387 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 @@ -59,7 +59,10 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { // special when using expression/predicates in the model private static final String ONE_OF_TYPE_NAME = "org.apache.camel.model.ExpressionSubElementDefinition"; - private static final String ONE_OF_LANGUAGES = "org.apache.camel.model.language.ExpressionDefinition"; + private static final String[] ONE_OF_LANGUAGES = new String[]{ + "org.apache.camel.model.language.ExpressionDefinition", + "org.apache.camel.model.language.NamespaceAwareExpression" + }; // special for inputs (these classes have sub classes, so we use this to find all classes) private static final String[] ONE_OF_INPUTS = new String[]{ "org.apache.camel.model.ProcessorDefinition", @@ -439,18 +442,20 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { if (isOneOf) { // okay its actually an language expression, so favor using that in the eip option kind = "expression"; - fieldTypeName = ONE_OF_LANGUAGES; - TypeElement languages = findTypeElement(roundEnv, ONE_OF_LANGUAGES); - String superClassName = canonicalClassName(languages.toString()); - // find all classes that has that superClassName - Set<TypeElement> children = new LinkedHashSet<TypeElement>(); - findTypeElementChildren(roundEnv, children, superClassName); - for (TypeElement child : children) { - XmlRootElement rootElement = child.getAnnotation(XmlRootElement.class); - if (rootElement != null) { - String childName = rootElement.name(); - if (childName != null) { - oneOfTypes.add(childName); + for (String language : ONE_OF_LANGUAGES) { + fieldTypeName = language; + TypeElement languages = findTypeElement(roundEnv, language); + String superClassName = canonicalClassName(languages.toString()); + // find all classes that has that superClassName + Set<TypeElement> children = new LinkedHashSet<TypeElement>(); + findTypeElementChildren(roundEnv, children, superClassName); + for (TypeElement child : children) { + XmlRootElement rootElement = child.getAnnotation(XmlRootElement.class); + if (rootElement != null) { + String childName = rootElement.name(); + if (childName != null) { + oneOfTypes.add(childName); + } } } } @@ -772,17 +777,19 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { // gather oneOf expression/predicates which uses language Set<String> oneOfTypes = new TreeSet<String>(); - TypeElement languages = findTypeElement(roundEnv, ONE_OF_LANGUAGES); - String superClassName = canonicalClassName(languages.toString()); - // find all classes that has that superClassName - Set<TypeElement> children = new LinkedHashSet<TypeElement>(); - findTypeElementChildren(roundEnv, children, superClassName); - for (TypeElement child : children) { - XmlRootElement rootElement = child.getAnnotation(XmlRootElement.class); - if (rootElement != null) { - String childName = rootElement.name(); - if (childName != null) { - oneOfTypes.add(childName); + for (String language : ONE_OF_LANGUAGES) { + TypeElement languages = findTypeElement(roundEnv, language); + String superClassName = canonicalClassName(languages.toString()); + // find all classes that has that superClassName + Set<TypeElement> children = new LinkedHashSet<TypeElement>(); + findTypeElementChildren(roundEnv, children, superClassName); + for (TypeElement child : children) { + XmlRootElement rootElement = child.getAnnotation(XmlRootElement.class); + if (rootElement != null) { + String childName = rootElement.name(); + if (childName != null) { + oneOfTypes.add(childName); + } } } }
