List all subclasses with fully qualified names

后端 未结 4 705
北海茫月
北海茫月 2021-01-13 08:18

I would like to get a list of all subclasses of a given class with their fully qualified names. I wanted to copy it from Eclipse and paste into a text file like this:

<
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-13 08:55

    Following the pattern described in http://internna.blogspot.com/2007/11/java-5-retrieving-all-classes-from.html one can do it programmatically. It's a shame Eclipse can't do it OOTB. Doing it in Java code allows to do the filtering with no additional cost (e.g. !(klazz.isEnum())).

提交回复
热议问题