Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » get the source associated with a class file
get the source associated with a class file [message #257530] Thu, 20 November 2008 13:18 Go to next message
Eclipse UserFriend
in my code, I get IJavaElement which actually represents a class file. Now
from this object, I want ICompilationUnit i.e. the source file
corresponding to this class file. I know there is a method in IClassFile
"getWorkingCopy" but I think using this method will have performance hit
as I think it will allocate some buffers and stuff? and I dont know how to
use the WorkingCopyOwner argument?

Bascially what I want to do is that given a class file, find the source
folder or package that the corresponding java source file is in..
Re: get the source associated with a class file [message #257549 is a reply to message #257530] Fri, 21 November 2008 10:15 Go to previous messageGo to next message
Eclipse UserFriend
please help!!
Re: get the source associated with a class file [message #257552 is a reply to message #257530] Fri, 21 November 2008 11:04 Go to previous messageGo to next message
Eclipse UserFriend
Raheel Ashraf a écrit :
> in my code, I get IJavaElement which actually represents a class file.
> Now from this object, I want ICompilationUnit i.e. the source file
> corresponding to this class file. I know there is a method in IClassFile
> "getWorkingCopy" but I think using this method will have performance hit
> as I think it will allocate some buffers and stuff? and I dont know how
> to use the WorkingCopyOwner argument?
If you .class file from the output folder ?
--
Olivier
Re: get the source associated with a class file [message #257558 is a reply to message #257552] Fri, 21 November 2008 11:11 Go to previous message
Eclipse UserFriend
yes i get the instance during a build i..e i have my own builder hooked
up..
Previous Topic:Syntax highlighting bug with Javadoc in method?
Next Topic:what is the primary compilation unit
Goto Forum:
  


Current Time: Mon Apr 21 02:19:06 EDT 2025

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

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

Back to the top