[forge-issues] [JBoss JIRA] (ROASTER-44) Support writing of nested annotation arrays

Matt Benson (JIRA) issues at jboss.org
Wed Nov 12 15:38:29 EST 2014


    [ https://issues.jboss.org/browse/ROASTER-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13019545#comment-13019545 ] 

Matt Benson commented on ROASTER-44:
------------------------------------

After further discussion on IRC between myself, [~gastaldi] and [~lincolnthree], we have decided the intermediate interface is not necessary and that this can be handled by the addition to {{AnnotationSource}}:

{code}
   /**
    * Add an annotation value.
    * @return the nested {@link AnnotationSource}
    * @see #addAnnotationValue(String)
    */
   AnnotationSource<O> addAnnotationValue();

   /**
    * Add a named annotation value. When there is no existing annotation or annotation array value for {@code name}, a
    * single unwrapped annotation value will be created (as with {@link #setAnnotationValue(String)}); otherwise an
    * unwrapped annotation value will be promoted to an array and a new element will be added.
    * 
    * @param name
    * @return the nested {@link AnnotationSource}
    */
   AnnotationSource<O> addAnnotationValue(String name);

   AnnotationSource<O> removeAnnotationValue(Annotation<O> element);

   AnnotationSource<O> removeAnnotationValue(String name, Annotation<O> element);
{code}

> Support writing of nested annotation arrays
> -------------------------------------------
>
>                 Key: ROASTER-44
>                 URL: https://issues.jboss.org/browse/ROASTER-44
>             Project: Roaster
>          Issue Type: Feature Request
>          Components: API, JDT
>    Affects Versions: 2.9.0.Final
>            Reporter: George Gastaldi
>             Fix For: 2.x Future
>
>
> Roaster should allow annotation nesting, like: 
> {code}
> @NamedQueries({
>     @NamedQuery(name="Customer.findAll", query="select C from Customer C"),
>     @NamedQuery(name="Customer.findByName", query="select C from Customer C where C.name = :name"),
>     @NamedQuery(name="Customer.findById", query="select C from Customer C where C.id = :id")
> })
> @Entity
> public class Customer  {...}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.8#6338)


More information about the forge-issues mailing list