Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-369

Return real annotations from org.jboss.forge.parser.java.AnnotationTarget.getAnnotation

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Do
    • Major
    • None
    • None
    • None
    • None

    Description

      The existing org.jboss.forge.parser.java.Annotation API is a bit unsymmetrical:

      public Annotation<O> getAnnotation(final Class<? extends java.lang.annotation.Annotation> type);

      You ask it for an Object that implements java.lang.annotation.Annotation, but you get back an Object that implements org.jboss.forge.parser.java.Annotation. It would be nice if you got back a 'real' annotation the same as java.lang.reflect.AnnotatedElement:

      public <T extends java.lang.annotation.Annotation> T getAnnotation(final Class<T> type);

      This is a little tricky because java.lang.annotation.Annotation is an interface. If it helps, I am using the attached rough code for now.

      Attachments

        Activity

          People

            lincolnthree Lincoln Baxter III (Inactive)
            kennardconsulting Richard Kennard (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: