Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2008

Tip: Looking for answers? Try searching our database.

Generating class and method references

Thread view: 
alejandrina - 27 Feb 2008 18:46 GMT
Hi all,

We would like to know the classes and methods that are called from
each class/method in our source base. One way is to insert @link tags
or @see tags, then generate javadoc, but is there an automatic way or
a better way (meaning javadoc is not a requirement)? We are using
Eclipse; I have not found a plugin that does this, but maybe I missed
the right one :)

Thanks,

Alejandrina
alejandrina - 27 Feb 2008 19:12 GMT
> Hi all,
>
[quoted text clipped - 8 lines]
>
> Alejandrina

Another solution would be some sort of "call hierarchy" tool that can
provide a complete call tree for a given class (or a whole project...)
with the ability to save the results to some file. Any ideas?

Alejandrina
Daniel Pitts - 27 Feb 2008 20:28 GMT
>> Hi all,
>>
[quoted text clipped - 14 lines]
>
> Alejandrina
What you're asking for falls under "static analysis".  I don't know if
you'll find anything, but googling for it might help.

Certain tools (I use Intellij IDEA) will let you search for uses of a
particular method.  I don't know if that is good enough for your actual
need (as you haven't specified what you're goal is).

The hard thing is that it can only include calls from code that you
provide.  If someone else uses your code from a different source tree,
you're out of luck.

Signature

Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>

Andrea Francia - 27 Feb 2008 21:07 GMT
With Netbeans you can search usages of a class or method simply with
right click -> Find Usages. I don't know if there is a similar function
in Eclipse.

> Hi all,
>
[quoted text clipped - 8 lines]
>
> Alejandrina
alejandrina - 27 Feb 2008 21:47 GMT
On Feb 27, 4:07 pm, Andrea Francia <andrea.fran...@gmx.it.invalid>
wrote:
> With Netbeans you can search usages of a class or method simply with
> right click -> Find Usages. I don't know if there is a similar function
[quoted text clipped - 12 lines]
>
> > Alejandrina

Actually there is a nifty Call Hierarchy plugin that does both ways
(who does this method call and who calls this method). This is not
sufficient, however: what I am looking for is a tool that does this
for (at a minimum) all the methods in a class and lets me export the
results to (for example) a text file or XML file or whatever.

Does anyone know if such a tool exists?

Thanks,

Alejandrina
Larry A Barowski - 28 Feb 2008 07:14 GMT
> Hi all,
>
[quoted text clipped - 4 lines]
> Eclipse; I have not found a plugin that does this, but maybe I missed
> the right one :)

If you want to roll your own, it is much easier to do this
for compiled classes rather than source. A minimal class
file scanner (all you need are class references from the
constant pool) is very simple. I would guess that you can
create your own tool in less time than you will spend
searching for one, and yours will do exactly what you
want in exactly the way you want.
alejandrina - 29 Feb 2008 19:59 GMT
On Feb 28, 2:14 am, "Larry A Barowski"
<ThisisLarrybarAtEngDotAuburnDotLearninginstitution> wrote:

> > Hi all,
>
[quoted text clipped - 12 lines]
> searching for one, and yours will do exactly what you
> want in exactly the way you want.
Intriguing...All I need now is some free time to do this :)

Thanks, I learned something new thanks to you

Alejandrina
Zig - 29 Feb 2008 07:18 GMT
> Hi all,
>
[quoted text clipped - 8 lines]
>
> Alejandrina

The "universal" way:
1) Rename your method
2) Recompile
3) See what blows up

The Eclipse way:
1) Click on the the method in source code
2) Ctrl+Shift+G

HTH,

-Zig
alejandrina - 29 Feb 2008 19:55 GMT
> > Hi all,
>
[quoted text clipped - 21 lines]
>
> -Zig

Thanks, but I need a tool that does this FOR ALL THE CLASSES IN A
PROJECT, not one Ctrl-Shift-G at a time. It is clear that Eclipse
knows this, but I don't know how to extract it in "report" form.

Alejandrina


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.