Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How to get the super AspectElement from a given AspectElement

Replies inline ...

On 25 Nov 2009, at 02:48, Andrew Eisenberg wrote:

Have you tried creating a supertype hierarchy?
IType.newSupertypeHierarchy()  That is what I should have suggested
first, better than find type.

Sadly, this does not behave as expected, apparantly it does not know how to make sense of aspects. If the aspect extends another aspect, the supertype array does not contain any entries, if the aspect does not extend, the supertype array contains only Object.

And this might also work as an AspectJ solution:

AsmManager.getAspectsWeavingFilesOnLastBuild()

You can get a handle on the AsmManager by this:
           AjCompiler compiler =
AspectJPlugin .getDefault().getCompilerFactory().getCompilerForProject(project);
           AsmManager existingState = compiler.getModel();

Haven't tried it myself...

I can almost make it from there, but not quite. I get access to a IHierarchy via existingState.getHierarchy(). However the interesting part, the map containing all types is a private member, and I dont see how the different methods allow me to get a hold of all the types.

AsmManager has @author Andy Clement. Andy, could you give some pointers on how to get to all the aspects woven on the last build so I can extract structure information from there?

As for the model of AspectJ and AJDT, it's something that I've always
wanted to do, but it is hard to find time for this with so many other
issues to deal with.


I know the feeling :-(

--
Johan Fabry
jfabry@xxxxxxxxxxxxx - http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile





Back to the top