Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 15686183F1 for ; Mon, 25 Jan 2016 15:26:25 +0000 (UTC) Received: (qmail 5075 invoked by uid 500); 25 Jan 2016 15:26:25 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 5024 invoked by uid 500); 25 Jan 2016 15:26:25 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 5015 invoked by uid 99); 25 Jan 2016 15:26:24 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jan 2016 15:26:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D6B82E0092; Mon, 25 Jan 2016 15:26:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Mon, 25 Jan 2016 15:26:24 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] camel git commit: CAMEL-9531: Camel catalog - method call, tokenizer and xtokenizer do not use @XmlValue. Repository: camel Updated Branches: refs/heads/camel-2.16.x 67c986ce9 -> aeb276300 refs/heads/master b9de13e60 -> 7d5af0fc6 CAMEL-9531: Camel catalog - method call, tokenizer and xtokenizer do not use @XmlValue. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7d5af0fc Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7d5af0fc Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7d5af0fc Branch: refs/heads/master Commit: 7d5af0fc668fc6eab8314f244967ad35ef04f649 Parents: b9de13e Author: Claus Ibsen Authored: Mon Jan 25 16:25:57 2016 +0100 Committer: Claus Ibsen Committed: Mon Jan 25 16:25:57 2016 +0100 ---------------------------------------------------------------------- .../camel/tools/apt/EipAnnotationProcessor.java | 25 +++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/7d5af0fc/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 b3ce1ca..85d340e 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 @@ -159,13 +159,13 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { } protected void writeJSonSchemeDocumentation(PrintWriter writer, RoundEnvironment roundEnv, TypeElement classElement, XmlRootElement rootElement, - String javaTypeName, String name) { + String javaTypeName, String modelName) { // gather eip information - EipModel eipModel = findEipModelProperties(roundEnv, classElement, javaTypeName, name); + EipModel eipModel = findEipModelProperties(roundEnv, classElement, javaTypeName, modelName); // get endpoint information which is divided into paths and options (though there should really only be one path) Set eipOptions = new TreeSet(new EipOptionComparator(eipModel)); - findClassProperties(writer, roundEnv, eipOptions, classElement, classElement, ""); + findClassProperties(writer, roundEnv, eipOptions, classElement, classElement, "", modelName); // after we have found all the options then figure out if the model accepts input/output eipModel.setInput(hasInput(roundEnv, classElement)); @@ -251,7 +251,7 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { } protected void findClassProperties(PrintWriter writer, RoundEnvironment roundEnv, Set eipOptions, - TypeElement originalClassType, TypeElement classElement, String prefix) { + TypeElement originalClassType, TypeElement classElement, String prefix, String modelName) { while (true) { List fieldElements = ElementFilter.fieldsIn(classElement.getEnclosedElements()); for (VariableElement fieldElement : fieldElements) { @@ -260,7 +260,7 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { XmlAttribute attribute = fieldElement.getAnnotation(XmlAttribute.class); if (attribute != null) { - boolean skip = processAttribute(roundEnv, originalClassType, classElement, fieldElement, fieldName, attribute, eipOptions, prefix); + boolean skip = processAttribute(roundEnv, originalClassType, classElement, fieldElement, fieldName, attribute, eipOptions, prefix, modelName); if (skip) { continue; } @@ -268,7 +268,7 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { XmlValue value = fieldElement.getAnnotation(XmlValue.class); if (value != null) { - processValue(roundEnv, originalClassType, classElement, fieldElement, fieldName, value, eipOptions, prefix); + processValue(roundEnv, originalClassType, classElement, fieldElement, fieldName, value, eipOptions, prefix, modelName); } XmlElements elements = fieldElement.getAnnotation(XmlElements.class); @@ -328,8 +328,8 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { } } - private boolean processAttribute(RoundEnvironment roundEnv, TypeElement originalClassType, TypeElement classElement, VariableElement fieldElement, String fieldName, XmlAttribute attribute, - Set eipOptions, String prefix) { + private boolean processAttribute(RoundEnvironment roundEnv, TypeElement originalClassType, TypeElement classElement, VariableElement fieldElement, + String fieldName, XmlAttribute attribute, Set eipOptions, String prefix, String modelName) { Elements elementUtils = processingEnv.getElementUtils(); String name = attribute.name(); @@ -381,12 +381,19 @@ public class EipAnnotationProcessor extends AbstractAnnotationProcessor { } private void processValue(RoundEnvironment roundEnv, TypeElement originalClassType, TypeElement classElement, VariableElement fieldElement, String fieldName, XmlValue value, - Set eipOptions, String prefix) { + Set eipOptions, String prefix, String modelName) { Elements elementUtils = processingEnv.getElementUtils(); // XmlValue has no name attribute String name = fieldName; + if ("method".equals(modelName) || "tokenize".equals(modelName) || "xtokenize".equals(modelName)) { + // skip expression attribute on these three languages as they are solely configured using attributes + if ("expression".equals(name)) { + return; + } + } + name = prefix + name; TypeMirror fieldType = fieldElement.asType(); String fieldTypeName = fieldType.toString();