users@codemodel.java.net

Re: JAnnotationUse

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Sat, 7 May 2011 11:02:20 +0200

Hi,

> I am working on a project where I have to write some source code. I
> discovered CodeModel, and start to use it.
> I would like to generate an annotation for a class, but it seems that what I
> would like to do is not implemented:
> Exemple :
>
> @RunWith(Arquillian.class)
>
> According to the api, there is some fonctions like that (in JAnnotationUse)
> :
>
> JAnnotationUse param(String name, boolean value)
> or
> JAnnotationUse param(String name, Class<?> value)
>
> I would like something like param(Class<?> value). Is it a mistake from me
> and it's possible to do it, but I just can't find it ?
> Or you just did not implemented it. Any solutions ? Would it be in the next
> releases ?

@RunWith(Arquillian.class) is a syntactic shorcut for @RunWith(value =
Arquillian.class), so just do param("value", "Arquillian.class").

As far as I remember, CodeModel will output it in abbreviated syntax,
@RunWith(Arquillian.class), if it is possible.

Bye,
/lexi