[ 
https://issues.apache.org/jira/browse/CAMEL-11675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16531281#comment-16531281
 ] 

ASF GitHub Bot commented on CAMEL-11675:
----------------------------------------

davsclaus commented on a change in pull request #2391: CAMEL-11675 - Repetable 
@Metadata annotation and amend apt for tooling
URL: https://github.com/apache/camel/pull/2391#discussion_r199783865
 
 

 ##########
 File path: 
tooling/apt/src/main/java/org/apache/camel/tools/apt/CoreEipAnnotationProcessor.java
 ##########
 @@ -219,8 +219,8 @@ protected EipModel 
findEipModelProperties(ProcessingEnvironment processingEnv, R
         boolean deprecated = classElement.getAnnotation(Deprecated.class) != 
null;
         model.setDeprecated(deprecated);
 
-        Metadata metadata = classElement.getAnnotation(Metadata.class);
-        if (metadata != null) {
+        Metadata[] metadataArray = 
classElement.getAnnotationsByType(Metadata.class);
+        for (Metadata metadata : metadataArray) {
 
 Review comment:
   I dont think we should just loop and override the label, eg we should get 
the metadata annotation that has no `key` set as that is what is used for 
components today. Or it should grab the first that is not empty.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> @Metadata should be repeatable
> ------------------------------
>
>                 Key: CAMEL-11675
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11675
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Luca Burgazzoli
>            Priority: Minor
>             Fix For: 2.23.0
>
>
> As today @Metadata is not repeatable so it is not easy to add multiple 
> information to i.e. a component, it would be nice to write something like:
> {code:java}
> @Metadata(key = "platforms", enums = { "spring", "spring-boot", "osgi" })
> @Metadata(key = "extensions", types = { MyExtension.cass })
> class MyComponent extends DefaultComponent {
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to