热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

检查jar中的哪些类扩展了一个抽象类-Checkwhichclassesinajarextendanabstractclass

Iamwonderingifthereisawaytocheck:foranabstractclass,whichclassesextendtheabstract

I am wondering if there is a way to check: for an abstract class, which classes extend the abstract class.

我想知道是否有办法检查:对于抽象类,哪些类扩展抽象类。

I am using IntelliJ IDEA.

我正在使用IntelliJ IDEA。

2 个解决方案

#1


2  

For any class to show the type hierarchy (super- and/or subclasses), position the cursor on the class name and press Ctrl+H. This will show the tree of type hierarchy. You can toggle between showing sub-classes, super-classes and both.

对于任何显示类型层次结构的类(超级和/或子类),将光标放在类名上并按Ctrl + H.这将显示类型层次结构树。您可以在显示子类,超类和两者之间切换。

Alternatively (thanks, @maydawn!) you can click the icon to the left of the line with the class name to show a popup with a list of sub-classes.

或者(感谢@maydawn!),您可以单击带有类名称的行左侧的图标,以显示带有子类列表的弹出窗口。

Type hierarchy

#2


0  

If you have access to or can generate the JavaDocs for the Jar, there should be a listing of all subclasses. For an example of this, see AbstractAction which has many subclasses.

如果您有权访问或可以为Jar生成JavaDoc,则应该有所有子类的列表。有关此示例,请参阅具有许多子类的AbstractAction。

One warning with this method is that it only shows direct subclasses, though this shouldn't be a serious limitation for most code bases with relatively shallow inheritance trees.

这种方法的一个警告是它只显示直接子类,尽管对于大多数具有相对浅的继承树的代码库来说这不应该是一个严重的限制。


推荐阅读
author-avatar
手机用户2602908893
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有