Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] JP Matching report?

Hi Johan,

You're right that it isn't in the model. Just haven't had it requested
yet.  We would appreciate if you could add an enhancement request into
bugzilla for this.

There is an experimental API that allows you to have access to the
actual compiler state (not just a structural and relationship model).
See the class org.eclipse.ajdt.core.model.AJWorldFacade.  It has a
relationship to an org.aspectj.weaver.World object.  You can copy the
code that allows you to gain access to World.

This object contains all information about the previous compile.  The
precedence is included, but it may be a little messy to get at it.

There are 4 methods that might be of interest to you:
World.compareByPrecedence,
World.getPrecedenceIfAny,
World.compareByPrecedenceAndHierarchy
World.getCrosscuttingMembersSet().getDeclareDominates()

A few notes of caution, though: World is not an API class, so read
access only.  It is also only valid for a single compile, so don't
hang on to it for longer than you need.

If you can send me some nice code, I'd consider adding it to
AJWorldFacade so that it can be part of the API.

Hope this helps.
--a

On Tue, Jan 27, 2009 at 9:30 AM, Johan Fabry <jfabry@xxxxxxxxxxxxx> wrote:
> Hi Andrew, all,
>
> I have been making good progress in my little JP Matching report plugin, but
> now am facing another problem: I'd like to know about precedence
> declarations in my aspects. I've tried to catch them in my
> IAdviceChangedListener using the
> getRelationshipsForProject(AJRelationshipManager.getAllRelationshipTypes())
> of the AJProjectModelFacade, but apparantly this is not a relationship that
> shows up there. How can I get to this information?
>
> Thanks in advance!
>
> On 13 Jan 2009, at 15:36, Andrew Eisenberg wrote:
>
>> Hi Johan!
>>
>> Well, you can get this information if you do a regular compile through
>> AJDT.  There is an API that you can use.  See:
>>
>> http://wiki.eclipse.org/Developer%27s_guide_to_building_tools_on_top_of_AJDT_and_AspectJ
>>
>> This may not be exactly what you are looking for, but it might be a start.
>
> --
> Johan Fabry
> jfabry@xxxxxxxxxxxxx - http://dcc.uchile.cl/~jfabry
> PLEIAD Lab - Computer Science Department (DCC) - University of Chile
>
>
>
>


Back to the top