Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » How to get method bindings with AsmHierarchyBuilder?
How to get method bindings with AsmHierarchyBuilder? [message #69302] Tue, 16 January 2007 16:56 Go to next message
Eclipse UserFriend
Originally posted by: m.bartsch.rdg.ac.uk

Hi,

I am trying to analyze AspectJ code and would like to retrieve method bindings from a method call
that appears in a source code file. I would like to know, for example, what is the return type of
the method call and what is the type of the object whose method is invoked.

Another reply to a similar email revealed that using an AjAST visitor does not seem to work (yet).
So I tried to find another way and found AsmHierachyBuilder. So far, I found out that the following
needs to be done:

1. Subclass AsmHierachyBuilder and implement the visit methods that I am interested in.
2. Register this visitor with Ajde.getDefault().getBuildManager().setAsmHierarchyBuilder
3. Compile the project. (?)

I have three questions:

1. Is this approach correct and might be the right way to obtain method bindings?
2. How do I compile an AspectJ project in Eclipse programmatically so that my registered
AsmHierarchyBuilder will be used? So far, I only saw solutions that passed a config.lst file to the
Ajde.getDefault().getBuildManager().build() method. I would like to avoid creating a config.lst
file, since there must already be a build configuration present in Eclipse. My code will run in an
Eclipse plugin.

Thanks a lot for your help and support,

Marc.
Re: How to get method bindings with AsmHierarchyBuilder? [message #69323 is a reply to message #69302] Wed, 17 January 2007 13:09 Go to previous messageGo to next message
Michael Pisula is currently offline Michael PisulaFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Marc,

as for compiling the project, I think I might help you, as we use
exactly the same approach in our AspectJ analysis tool. Basically we set
the HierarchyBuilder to our subclass and then call project.build(..) on
the IProject object of the project we want to build. In between we set
the current AspectJProject with
AspectJPlugin.getDefault().setCurrentProject(project);
and set the build configuration we want to use.

Hope I could help you there.

Michael
Re: How to get method bindings with AsmHierarchyBuilder? [message #69339 is a reply to message #69323] Thu, 18 January 2007 12:15 Go to previous message
Eclipse UserFriend
Originally posted by: m.bartsch.rdg.ac.uk

Hi Michael,

Thanks a lot for your help. I had a quick look at it and it works brilliantly. Sometimes, the things
are just right under your nose.

Best wishes,

Marc.

Michael Pisula schrieb:
> Hi Marc,
>
> as for compiling the project, I think I might help you, as we use
> exactly the same approach in our AspectJ analysis tool. Basically we set
> the HierarchyBuilder to our subclass and then call project.build(..) on
> the IProject object of the project we want to build. In between we set
> the current AspectJProject with
> AspectJPlugin.getDefault().setCurrentProject(project);
> and set the build configuration we want to use.
>
> Hope I could help you there.
>
> Michael
Re: How to get method bindings with AsmHierarchyBuilder? [message #595760 is a reply to message #69302] Wed, 17 January 2007 13:09 Go to previous message
Michael Pisula is currently offline Michael PisulaFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Marc,

as for compiling the project, I think I might help you, as we use
exactly the same approach in our AspectJ analysis tool. Basically we set
the HierarchyBuilder to our subclass and then call project.build(..) on
the IProject object of the project we want to build. In between we set
the current AspectJProject with
AspectJPlugin.getDefault().setCurrentProject(project);
and set the build configuration we want to use.

Hope I could help you there.

Michael
Re: How to get method bindings with AsmHierarchyBuilder? [message #595769 is a reply to message #69323] Thu, 18 January 2007 12:15 Go to previous message
Eclipse UserFriend
Originally posted by: m.bartsch.rdg.ac.uk

Hi Michael,

Thanks a lot for your help. I had a quick look at it and it works brilliantly. Sometimes, the things
are just right under your nose.

Best wishes,

Marc.

Michael Pisula schrieb:
> Hi Marc,
>
> as for compiling the project, I think I might help you, as we use
> exactly the same approach in our AspectJ analysis tool. Basically we set
> the HierarchyBuilder to our subclass and then call project.build(..) on
> the IProject object of the project we want to build. In between we set
> the current AspectJProject with
> AspectJPlugin.getDefault().setCurrentProject(project);
> and set the build configuration we want to use.
>
> Hope I could help you there.
>
> Michael
Previous Topic:How to get method bindings with AsmHierarchyBuilder?
Next Topic:Wiki page for AJDT/AspectJ extenders
Goto Forum:
  


Current Time: Thu Apr 25 09:43:26 GMT 2024

Powered by FUDForum. Page generated in 0.03545 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top