Skip to main content


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 GrishchenkoFriend
Messages: 104
Registered: July 2009
Senior 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 MegertFriend
Messages: 3802
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 GrishchenkoFriend
Messages: 104
Registered: July 2009
Senior 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 MegertFriend
Messages: 3802
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: Wed Apr 24 19:42:25 GMT 2024

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

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

Back to the top