[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
Re: [aspectj-users] errors compiling annotations
|
- From: "Dean Wampler" <deanwampler@xxxxxxxxx>
- Date: Wed, 19 Apr 2006 07:41:57 -0500
- Delivered-to: aspectj-users@eclipse.org
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=URg896/xoV7VUioO/FGEgx4I8znTPZ0kV/X4YS9Z3hH5wavRoxpMPLBuBKR8EAs3qa+3c861z8fP7EdGRSUciQPadk39lMg1jA2DQnYnwKRcbmIIv43moy6cJuDbC+gxfdYlqLL1qpw8JP/ughJYBp2DkKuASZgGtL2P/k/GxbY=
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