[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Correspondence between IJavaElement and ASTNode

David wrote:
[..]
I'd like to know if it is possible to obtain the corresponding ASTNode from an IJavaElement ? For example, if I have an IMethod, can I obtain the corresponding MethodDeclaration ?
[..]

The mapping from e.g. IMethod to a corresponding ASTNode is a bit more involved. E.g. an IMethod can map to a MethodDeclaration or to an AnnotationTypeMemberDeclaration.

There's no public API to do this mapping.

In JDT/UI, we use our internal classes NodeFinder and ASTNodeSearchUtil.

HTH,
Markus