find all classes and interfaces a class extends or implements recursively

后端 未结 8 1333
孤独总比滥情好
孤独总比滥情好 2021-02-12 22:13

I was wondering if there was an easy way of determining the complete list of Types that a Java class extends or implements recursively?

for instance:

cla         


        
8条回答
  •  萌比男神i
    2021-02-12 22:43

    From the question How do you find all subclasses of a given class in Java?, this answer might be helpful:

    Using the class PojoClassImpl.java you can get the super class by calling method getSuperClass(). I think that is sufficient for you to write a recursive method.

提交回复
热议问题