IJavaModel, AST and Bindings [message #259449] |
Wed, 08 April 2009 14:03 |
Krzysztof Kowalczyk 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
|
|
|
Powered by
FUDForum. Page generated in 0.02894 seconds