Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Get IResource for java file knowning IClassFile derived from it?
Get IResource for java file knowning IClassFile derived from it? [message #260847] Sun, 28 June 2009 07:57 Go to next message
Vladimir Grishchenko is currently offline Vladimir Grishchenko
Messages: 76
Registered: July 2009
Member
Is there an easy way to lookup the original java file, as IResource
ideally, knowing the class file that was compiled from it? I'm trying to
indirectly use JDT's dependency analyzer to find out which java files were
compiled inside an Ant builder/custom task. I can get Eclipse pass the
incremental build resource delta to my Ant script which includes generated
class files, and I need to resolve them to their originating source files.
Perhaps there is a better way to solve this? Thanks.

-V.
Re: Get IResource for java file knowning IClassFile derived from it? [message #260864 is a reply to message #260847] Mon, 29 June 2009 09:55 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
Vladimir Grishchenko wrote:
> Is there an easy way to lookup the original java file, as IResource
> ideally, knowing the class file that was compiled from it?
There's no single API that would give you this.

Dani
> I'm trying to indirectly use JDT's dependency analyzer to find out
> which java files were compiled inside an Ant builder/custom task. I
> can get Eclipse pass the incremental build resource delta to my Ant
> script which includes generated class files, and I need to resolve
> them to their originating source files. Perhaps there is a better way
> to solve this? Thanks.
>
> -V.
>
>
Re: Get IResource for java file knowning IClassFile derived from it? [message #260887 is a reply to message #260864] Mon, 29 June 2009 18:25 Go to previous messageGo to next message
Vladimir Grishchenko is currently offline Vladimir Grishchenko
Messages: 76
Registered: July 2009
Member
Daniel Megert wrote:

> Vladimir Grishchenko wrote:
>> Is there an easy way to lookup the original java file, as IResource
>> ideally, knowing the class file that was compiled from it?
> There's no single API that would give you this.

> Dani

Fair enough. Then it looks like the solution will be to search in the
source folders inside the corresponding packages. Does this sound like a
plausible approach?

-Vladimir
Re: Get IResource for java file knowning IClassFile derived from it? [message #261014 is a reply to message #260887] Mon, 06 July 2009 14:49 Go to previous message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
Vladimir Grishchenko wrote:
> Daniel Megert wrote:
>
>> Vladimir Grishchenko wrote:
>>> Is there an easy way to lookup the original java file, as IResource
>>> ideally, knowing the class file that was compiled from it?
>> There's no single API that would give you this.
>
>> Dani
>
> Fair enough. Then it looks like the solution will be to search in the
> source folders inside the corresponding packages. Does this sound like
> a plausible approach?
Yep. As a first guess you could simply check whether there's a
corresponding *.java file / Compilation Unit and if not, do the search.

Dani
>
> -Vladimir
>
Previous Topic:A modal dialog box like Open Type Dialog Box
Next Topic:Reuse basic Java Editor
Goto Forum:
  


Current Time: Thu Oct 23 15:22:08 GMT 2014

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

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