Resolving Bindings without compiling? [message #251702] |
Fri, 29 February 2008 10:29  |
Eclipse User |
|
|
|
Originally posted by: tansey.vt.edu
Hi all!
I'm working on a project where we want to be able to use the JDT both
inside and outside of Eclipse. For the project, we need to call
resolveBindings() on some nodes, but it's returning null when we parse
the source. Our fear is that we'll have to compile the code (meaning
handle dependency, classpath, etc. issues) in order to get the bindings.
Is there any way to get back bindings by only parsing the code, not
compiling it?
Sincerely,
Wesley
|
|
|
Re: Resolving Bindings without compiling? [message #251711 is a reply to message #251702] |
Fri, 29 February 2008 10:43  |
Eclipse User |
|
|
|
Originally posted by: myawn.ebay.com
Wesley Tansey wrote:
> Hi all!
>
> I'm working on a project where we want to be able to use the JDT both
> inside and outside of Eclipse. For the project, we need to call
> resolveBindings() on some nodes, but it's returning null when we parse
> the source. Our fear is that we'll have to compile the code (meaning
> handle dependency, classpath, etc. issues) in order to get the bindings.
> Is there any way to get back bindings by only parsing the code, not
> compiling it?
>
> Sincerely,
> Wesley
When you parse the source, are you calling
parse.setResolveBindings(true);
before creating the AST?
Also, if you have issues with dependencies, classpath, etc., I'm not
sure whether the AST will be able to return bindings to you. It's kind
of the whole point of bindings that they are resolved -- for example, if
you have code that refers to type Date, you might check the resolved
bindings to see whether that is java.util.Date, java.sql.Date, or
com.myprivatepackage.Date. I'm not an expert in this area, but I don't
see how the AST is going to be able to return correct bindings to you if
the code isn't buildable.
Mike
|
|
|
Powered by
FUDForum. Page generated in 0.05783 seconds