简体   繁体   English

Java IDE - 查找函数或类的所有INDIRECT用法/引用?

[英]Java IDE - find all INDIRECT usages/references of a function or class?

In Netbeans or in Eclipse, you can use "Find Usages" or "References" from the right click context menu. 在Netbeans或Eclipse中,您可以使用右键单击上下文菜单中的“查找用法”或“引用”。 If a() calls b(), using the functionality from b() will show you a(). 如果a()调用b(),则使用b()中的函数将显示a()。 However, what I want is to be able to see some kind of tree or have an option to see all usages of a given/class or method, such that if z() calls a() that using the functionality will show both z() and a(). 但是,我想要的是能够看到某种树或者有一个选项来查看给定/类或方法的所有用法,这样如果z()调用a(),使用该功能将显示两个z( )和a()。

Any IDE plugins or external tools that can do this? 任何可以执行此操作的IDE插件或外部工具?

Eclipse gives you a way to see Call hierarchy using Ctrl+ Alt + H or choose from the menu like references. Eclipse为您提供了一种使用Ctrl + Alt + H查看Call层次结构的方法,或者从菜单中选择引用。 This should show you the entire call tree for this method. 这应该显示此方法的整个调用树。

Use PMD or CheckStyle and have it construct an abstract syntax tree. 使用PMD或CheckStyle并使其构造一个抽象语法树。 You can then use that to find indirect usages/references. 然后,您可以使用它来查找间接使用/引用。

如果使用Eclipse,请查看“调用层次结构”视图。

Check out nWire for Java . 查看nWire for Java It shows all the code associations in one view, which can be further expanded and explored. 它显示了一个视图中的所有代码关联,可以进一步扩展和探索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM