Which version of AspectJ 1.5 are you
using? 1.5.0M1 can't compile
1.5 constructs, it can only weave them.
*But* if you have a recent Dev build
of AspectJ (see the downloads page),
everything you have described should
work (although you will need to mark
your Inspector annotation with
runtime retention).
Andy.
Rodrigo Gonçalves <locomotiva_diesel@xxxxxxxxxxxx> Sent by: aspectj-users-admin@xxxxxxxxxxx
27/02/2005 14:58
Please respond to
aspectj-users@xxxxxxxxxxx
To
aspectj-users@xxxxxxxxxxx
cc
Subject
[aspectj-users] How to use JAVA5 Annotations
Hi,
I'm working on an aspect using JAVA5 Annotations but can't
seem to make the weaver understand what annotations are...
(I'm using J2RE1.5 and aspectj1.5)
I'm getting trouble on three code snippets:
1) On the following pointcut:
public pointcut setAsGet() : within(@Inspector *) &&
set(private * *.*);
...the weaver says: [error] Type referred to is
not an annotation type: pp.Inspector
2) on the Annotation definition:
package pp;
public @interface Inspector
{
}
...the weaver says:
[error] Syntax error on token "AT", delete this
token public @interface Constructor
3) and when I use the Annotation:
@Inspector
public int getField()
{
return field_;
}
...the weaver says:
[error] Syntax error on token "AT", invalid
AspectHeaderName
@Inspector
Now, what am I doing wrong? This is just a simple-as-hell
aspect and I can't seem to make it work right or to figure why the weaver
can't understand what I coded.
Also, I'm using the Annotation definition in a .java file,
the aspect in a .aj file and the the class that makes use of the Annotation
in another .java file.
Thank you very much
Rodrigo
Yahoo!
Acesso Grátis - Internet rápida e grátis. Instale
o discador do Yahoo! agora.