How to get Full Call graph for Documentation Purposes?
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?
I highly recommend doxygen.
Even with "un-treated" code, it will generate calls trees, class inheritance diagrams and more as HTML. If you add a few specially formatted comments (one per class, function, noteable data structure) you can get much more out of it.
Check out the examples and the huge list of projects that use doxygen.
I personally would not use anything else and insist that all code written in my company uses doxygen.
Edit: P.s doxygenis so useful, even on uncommented code that it's the first tool I look for when I inherit someone else's legacy code. Nothing else gives me such a good overview so quickly.
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.
精彩评论