Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] AJModel - Getting details about PointcutElement, AdviceElement and DeclareElements

Hi,

Have you tried converting the IJavaElements (JDT objects) to
IProgramElements (AspectJ objects)?

See http://wiki.eclipse.org/Developer%27s_guide_to_building_tools_on_top_of_AJDT_and_AspectJ


Let's say that pointcutElement is of type PointcutElement:

AJProjectModelFacade model =
AJProjectModelFactory.getInstance().getModelForJavaElement(pointcutElement);

IProgramElement ipe = model.javeElementToProgramElement(poincutElement);

And you can get a bunch of information about the pointcut that you
couldn't before.


> However, I could not cast the PointcutElement  into ISourceReference.

Why not?  PoincutElement implements ISourceReference.
Make sure you are using org.eclipse.jdt.core.ISourceReference and not
org.aspectj.org.eclipse.jdt.core.ISourceReference.


Please raise an enhancement request that describes exactly what kind
of information you would like to see.  Also, if you were to submit a
patch that implements this functionality, we would definitely consider
integrating it with AJDT.


Back to the top