Skip to main content



      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 03:57 Go to next message
Eclipse UserFriend
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 05:55 Go to previous messageGo to next message
Eclipse UserFriend
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 14:25 Go to previous messageGo to next message
Eclipse UserFriend
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 10:49 Go to previous message
Eclipse UserFriend
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 May 08 17:48:05 EDT 2025

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

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

Back to the top