[forge-issues] [JBoss JIRA] (FORGE-369) Return real annotations from org.jboss.forge.parser.java.AnnotationTarget.getAnnotation

Richard Kennard (Updated) (JIRA) jira-events at lists.jboss.org
Sun Oct 30 02:31:45 EDT 2011


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

Richard Kennard updated FORGE-369:
----------------------------------

    Attachment: AnnotationProxy.java


Simple implementation of an Annotation Proxy. Usage:

return AnnotationProxy.newInstance(qualifiedAnnotationName);
                
> Return real annotations from org.jboss.forge.parser.java.AnnotationTarget.getAnnotation
> ---------------------------------------------------------------------------------------
>
>                 Key: FORGE-369
>                 URL: https://issues.jboss.org/browse/FORGE-369
>             Project: Forge
>          Issue Type: Enhancement
>            Reporter: Richard Kennard
>            Assignee: Lincoln Baxter III
>         Attachments: AnnotationProxy.java
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the forge-issues mailing list