From commits-return-65325-archive-asf-public=cust-asf.ponee.io@camel.apache.org Fri Sep 21 14:58:55 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 20DF8180656 for ; Fri, 21 Sep 2018 14:58:54 +0200 (CEST) Received: (qmail 32577 invoked by uid 500); 21 Sep 2018 12:58:54 -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 32563 invoked by uid 99); 21 Sep 2018 12:58:54 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Sep 2018 12:58:54 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id A050C82E9B; Fri, 21 Sep 2018 12:58:53 +0000 (UTC) Date: Fri, 21 Sep 2018 12:58:53 +0000 To: "commits@camel.apache.org" Subject: [camel] branch master updated: CAMEL-12826: Add missing documentation in camel... MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <153753473338.22320.18164396297327683711@gitbox.apache.org> From: zregvart@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: camel X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: fc9bbd4da331bd8de35a76603f184b2f2b70a324 X-Git-Newrev: 57533d4cf076ef0c1dc239fa1bc3085ee02297b4 X-Git-Rev: 57533d4cf076ef0c1dc239fa1bc3085ee02297b4 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git The following commit(s) were added to refs/heads/master by this push: new 57533d4 CAMEL-12826: Add missing documentation in camel... 57533d4 is described below commit 57533d4cf076ef0c1dc239fa1bc3085ee02297b4 Author: Zoran Regvart AuthorDate: Fri Sep 21 14:58:50 2018 +0200 CAMEL-12826: Add missing documentation in camel... ...-grape and skip Groovy `metaClass` property in APT This adds documentation reported missing by the `camel-package:validate-components`. Also ignores the Groovy `metaClass` property added by the Groovy compiler. --- .../camel-grape/src/main/docs/grape-component.adoc | 18 ++++++++++++----- .../camel/component/grape/GrapeComponent.groovy | 2 ++ .../camel/component/grape/GrapeEndpoint.groovy | 2 +- .../tools/apt/EndpointAnnotationProcessor.java | 23 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/components/camel-grape/src/main/docs/grape-component.adoc b/components/camel-grape/src/main/docs/grape-component.adoc index e319662..2f3644a 100644 --- a/components/camel-grape/src/main/docs/grape-component.adoc +++ b/components/camel-grape/src/main/docs/grape-component.adoc @@ -13,7 +13,16 @@ without the restart of the router. ### Grape options // component options: START -The Grape component has no options. +The Grape component supports 2 options, which are listed below. + + + +[width="100%",cols="2,5,^1,2",options="header"] +|=== +| Name | Description | Default | Type +| *patchesRepository* (advanced) | Implementation of org.apache.camel.component.grape.PatchesRepository, by default: FilePatchesRepository | | PatchesRepository +| *resolveProperty Placeholders* (advanced) | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | boolean +|=== // component options: END @@ -32,18 +41,17 @@ with the following path and query parameters: [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type -| *defaultCoordinates* | *Required* Maven coordinates to use as default to grab if the message body is empty. | | String +| *defaultCoordinates* | *Required* Maven coordinates to use as default to grab if the message body is empty | | String |=== -==== Query Parameters (2 parameters): +==== Query Parameters (1 parameters): [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type -| *exchangePattern* () | Sets the default exchange pattern when creating an exchange. | InOnly | ExchangePattern -| *synchronous* () | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). | false | boolean +| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean |=== // endpoint options: END diff --git a/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeComponent.groovy b/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeComponent.groovy index 5a4dd51..9596da1 100644 --- a/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeComponent.groovy +++ b/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeComponent.groovy @@ -18,9 +18,11 @@ package org.apache.camel.component.grape import org.apache.camel.CamelContext import org.apache.camel.impl.UriEndpointComponent +import org.apache.camel.spi.Metadata class GrapeComponent extends UriEndpointComponent { + @Metadata(label = "advanced", description = "Implementation of org.apache.camel.component.grape.PatchesRepository, by default: FilePatchesRepository") private PatchesRepository patchesRepository = new FilePatchesRepository() GrapeComponent() { diff --git a/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeEndpoint.groovy b/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeEndpoint.groovy index aa58b43..0686a4f 100644 --- a/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeEndpoint.groovy +++ b/components/camel-grape/src/main/groovy/org/apache/camel/component/grape/GrapeEndpoint.groovy @@ -34,7 +34,7 @@ import static org.apache.camel.component.grape.MavenCoordinates.parseMavenCoordi @UriEndpoint(firstVersion = "2.16.0", scheme = "grape", syntax = "grape:defaultCoordinates", title = "Grape", producerOnly = true, label = "management,deployment") class GrapeEndpoint extends DefaultEndpoint { - @UriPath @Metadata(required = "true") + @UriPath(description = "Maven coordinates to use as default to grab if the message body is empty") @Metadata(required = "true") private final String defaultCoordinates GrapeEndpoint(String endpointUri, String defaultCoordinates, GrapeComponent component) { 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 049213f..3726d83 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 @@ -25,6 +25,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Set; + import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; @@ -34,6 +35,7 @@ import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; +import javax.lang.model.type.DeclaredType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.lang.model.util.ElementFilter; @@ -473,6 +475,10 @@ public class EndpointAnnotationProcessor extends AbstractProcessor { continue; } + if (isGroovyMetaClassProperty(method)) { + continue; + } + // must be a getter/setter pair String fieldName = methodName.substring(3); fieldName = fieldName.substring(0, 1).toLowerCase() + fieldName.substring(1); @@ -811,4 +817,21 @@ public class EndpointAnnotationProcessor extends AbstractProcessor { // CHECKSTYLE:ON + private static boolean isGroovyMetaClassProperty(final ExecutableElement method) { + final String methodName = method.getSimpleName().toString(); + + if (!"setMetaClass".equals(methodName)) { + return false; + } + + if (method.getReturnType() instanceof DeclaredType) { + final DeclaredType returnType = (DeclaredType) method.getReturnType(); + + return "groovy.lang.MetaClass".equals(returnType.asElement().getSimpleName()); + } else { + // Eclipse (Groovy?) compiler returns javax.lang.model.type.NoType, no other way to check but to look at toString output + return method.toString().contains("(groovy.lang.MetaClass)"); + } + } + }