[cdi-dev] [JBoss JIRA] (CDI-481) Introduce AnnotatedParameter.getJavaParameter()

Martin Kouba (JIRA) issues at jboss.org
Mon Nov 14 03:52:01 EST 2016


     [ https://issues.jboss.org/browse/CDI-481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Kouba reassigned CDI-481:
--------------------------------

    Assignee: Martin Kouba


> Introduce AnnotatedParameter.getJavaParameter()
> -----------------------------------------------
>
>                 Key: CDI-481
>                 URL: https://issues.jboss.org/browse/CDI-481
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Portable Extensions
>            Reporter: Jozef Hartinger
>            Assignee: Martin Kouba
>             Fix For: 2.0 .Final
>
>
> Make it possible to obtain the Java Reflection object representing the parameter. This is in line with
> AnnotatedField.getJavaMember()
> AnnotatedMethod.getJavaMember()
> AnnotatedConstructor.getJavaMember()
> Can be implemented as a default method such as:
> {code:JAVA}
> default Parameter getJavaParameter() {
>         Member member = getDeclaringCallable().getJavaMember();
>         if (!(member instanceof Executable)) {
>             throw new IllegalStateException("Parameter does not belong to an executable " + member);
>         }
>         Executable executable = (Executable) member;
>         return executable.getParameters()[getPosition()];
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the cdi-dev mailing list