Given the java.lang.reflect.Method object, is there an easy way to get the hierarchy of methods that it overrides

Given the java.lang.reflect.Method object, there is an easy way to get the hierarchy of methods that it overrides. For instance:

class A {
    public void someMethod() { ... }
}

interface B {
    public void someMethod();
}

class C extends A {
    public void someMethod() { ... }
}

class D extends C implements B {
    public void someMethod() { ... }
}

Given the java.lang.reflect.Method object for D # someMethod, can I easily get the tree:

D#someMethod
 |
 +- C#someMethod
 |   |
 |   +- A#someMethod
 |
 +- B#someMethod

I think there should be an easy way to do this, perhaps an existing library?

0
source share
1 answer

, assylias , ( ). , , "".

0

All Articles