Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-481

Introduce AnnotatedParameter.getJavaParameter()

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 2.0 .Final
    • None
    • Portable Extensions
    • None

      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:

      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()];
          }
      

              mkouba@redhat.com Martin Kouba
              rhn-engineering-jharting Jozef Hartinger
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: