Another option is to post-process declare warning messages.
Given
aspect A {
declare warning: Permissions.access() :
"Access";
}
ajc will emit messages of the form
------------
C:\src\C.java:44 [warning] Access class C { void m(){}
} ^^^^^^^^^^^^^^^^^^^^^
method-execution(void M.m()) see
also: C:\src\A.java:22::0
Capture the messages from the command-line or by installing a
message handler (using iajc/Ant or the very new undocumented
ajc flag -messageHolder) and munge them to produce a config file.
Not pretty!
Wes
------------Original Message------------
From: "Andy Clement" <andrew.clement@xxxxxxxxx>
To: aspectj-users@xxxxxxxxxxx
Date: Fri, Mar-3-2006 0:11 AM
Subject: Re: [aspectj-users] Need to enumerate all methods for selected
advices of an aspect The new reflection support in AspectJ5 will allow
you to query what the advice declarations are, but *not* where they
are affecting (that may follow when we get some time...)
It is
possible to use your own message handler which will then get callbacks for
'weave info' messages. To see the kind of information you would get,
turn on weave info messages in the AJDT options panel or pass
-showWeaveInfo to the compiler. If it looks like what you want, write
an implementation of IMessageHolder and pass the class name with
-messageHolder to the compiler ... I think that will work,
although I've not tried it !!
Andy.
On 03/03/06, András
Imre <andras.imre@xxxxxxxxx>
wrote:
Hi,
I
have an aspect, which checks access permissions before allowing execution
of certain methods for the current user. This is done with around
advice.
Now I'd like generate a file, in which each affected method
is listed for this aspect. In this way I'd have an automated way to
get an always up-to-date template which could be used for creating an
access permission configuration file.
I see this info e.g. on the
Cross References tab in Eclipse, and as AspectJ markers, but cant export
from either, and would not be automatic. Is there a way to generate
this automatically, preferably in similar format and structure to the
thisJoinPoint.toString() variations?
I tried messing with
reflection, but could not access aspects this way... Can aspects be
investigated
runtime?
Thanks, András _______________________________________________ aspectj-users
mailing list aspectj-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list aspectj-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/aspectj-users
|