Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » IJavaModel, AST and Bindings
IJavaModel, AST and Bindings [message #259449] Wed, 08 April 2009 14:03
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
Hi,

I need to walk around Java code.

I use IJavaModel now, it is mostly simple and fast, except that I have
to handle signatures and resolve them to Types all the time and it is
painful
(e.g. IMetod.getReturnType -> check kind of type -> Signature.toString
then IType.resolveType -> javaproject.findType).

Now I see I would need AST sometimes (e.g. to check method body, look
for a function type). So I wonder how to handle it.

How can I get AST for given IJavaElement ?
Can ICompilationUnit.reconcile be used for that?
Can I get e.g. TypeBinding for given IType ?

Maybe I should always use ASTParser ?

Maybe I don't have to use IJavaModel for reading Java structure, as I
have Bindings know? No need for resolving types, but Bindings are
expensive. Can I get bindings directly without creating AST ?

Regards,
Chris
Previous Topic:Classpath variable extension -- can the icon be changed?
Next Topic:Can I have all my workspaces use the same preferences?
Goto Forum:
  


Current Time: Thu Dec 26 14:34:51 GMT 2024

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

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

Back to the top