[cdi-dev] [JBoss JIRA] (CDI-474) Enrich AnnotatedParameter to get access to parameter name

Antonin Stefanutti (JIRA) issues at jboss.org
Mon Sep 15 06:28:02 EDT 2014


Antonin Stefanutti created CDI-474:
--------------------------------------

             Summary: Enrich AnnotatedParameter to get access to parameter name
                 Key: CDI-474
                 URL: https://issues.jboss.org/browse/CDI-474
             Project: CDI Specification Issues
          Issue Type: Feature Request
          Components: Portable Extensions
            Reporter: Antonin Stefanutti


With [JEP 118|http://openjdk.java.net/jeps/118] (Access to Parameter Names at Runtime) introduced in Java 8, the CDI SPI could be enriched so that {{AnnotatedParameter}} provide access to parameter names of methods and constructors.

In addition to class and method names that are used for default naming convention in producer methods that rely on {{InjectionPoint}} metadata, parameter name could be used as well to implement default convention for method parameter injection point.

One example of such a pattern is implemented in the [Metrics CDI extension|https://github.com/astefanutti/metrics-cdi#metrics-injection] and that would avoid to rely on the Java API: https://github.com/astefanutti/metrics-cdi/blob/master/impl/src/main/java/io/astefanutti/metrics/cdi/MetricProducer.java#L126.

That is something Spring 4 now provides with [SPR-9643|https://jira.spring.io/browse/SPR-9643].



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the cdi-dev mailing list