views:

51

answers:

2

Our team is being required to document every method in our code, and describe what's getting passed in and out and such. Is it possible to auto-generate a document containing a full call hierarchy tree starting at a function and going down to all the possible call expansions? How? Using eclipse, spring, hibernate. Also we have access to Netbeans, and anything else that would help.

I know it's completely unnecessary, but sometimes we find ourselves in these situations and can't do much about it :-).

Basically I need a java call graph generator, I think the reason I can't find one is because virtual functions prevent static analysis?

+1  A: 

It is not a exact solution to your problem, buy you could use the Doclet API and write your own Doclet. You can access methods with their arguments and their return types and much more. When you go this way you can also grab the comments of the method for documentation purposes.

mpistrich
+1  A: 

I highly recommend DoxyGen.

Even with "un-treated" coide, it will generate calls trees, class inheitance diagrams and more as HTML. If you add a few specially formatted comments (one per class, function, noteable data structure) you cven get much more out of it.

Check out the examples and the huge list of projects that use doxygen.

I presonally would not use anything else and insist that all code written in my company uses DoxyGen.

Edit: P.s DoxyGen is so useful, even on uncommented code that it's the first tool I look for when I inheit someone else's legacy code. Nothing else gives me such agood overview so quickly.

LeonixSolutions
looks perfect, I will try it. Thanks!
Gary