如何获取完整的调用图以用于文档目的?
我们的团队需要记录代码中的每个方法,并描述传入和传出的内容等。是否可以自动生成一个包含完整调用层次结构树的文档,该树从一个函数开始一直到所有可能的调用扩展?如何?使用eclipse、spring、hibernate。我们还可以访问 Netbeans 以及其他任何有帮助的东西。
我知道这是完全没有必要的,但有时我们发现自己处于这种情况下,对此无能为力:-)。
基本上我需要一个java调用图生成器,我想我找不到它的原因是因为虚函数阻止了静态分析?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我强烈推荐 doxygen。
即使使用“未经处理”的代码,它也会生成调用树、类继承图等 HTML 形式。如果您添加一些特殊格式的注释(每个类、函数、值得注意的数据结构一个),您可以从中获得更多信息。
查看示例和巨大的示例。 nl/projects.html" rel="nofollow noreferrer">使用 doxygen 的项目列表。
我个人不会使用其他任何东西,并坚持我公司编写的所有代码都使用 doxygen。
编辑:Ps doxygenis 非常有用,即使在未注释的代码上也是如此,当我继承别人的遗留代码时,它是我寻找的第一个工具。没有什么比这更能让我如此快速地了解情况了。
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.
这不是您问题的精确解决方案,您可以使用 Doclet API 并编写自己的 Doclet。您可以访问方法及其参数和返回类型等等。当您采用这种方式时,您还可以获取该方法的注释以用于文档目的。
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.