Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] errors compiling annotations

No, annotations are like regular classes & interfaces. They have to be
declared and defined.

Can you reduce the number of annotations you need by embedding
information in them, for example, by using, a descriptive string or an
enum, like the ones used by the predefined @Target and @Retention
annotations?

Dean

On 4/19/06, mouna SAHIB <mouna.sahib@xxxxxxxxx> wrote:
> I have a question about using annotations to reference methods but not in
> relation with the errors I had:
> Is it necessary to create annotations interfaces to use them? I expected to
> have the possiblity of tagging my methods like this:
>
> @MyMethod
> public void MaMethode(){
> /*
> * some code
> */
> }
> Without creating the interface:
> public @interface MyMethod {
> }
>
> Is it possible?
> If not, that means that I have to create as much interfaces as annotations
> I'm using! It's not very appreciable if I have many annotations to use! Is
> it?
>

--
Dean Wampler
http://www.aspectprogramming.com
http://www.newaspects.com
http://www.contract4j.org


Back to the top