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
|
+- C
| |
| +- A
|
+- B
I think there should be an easy way to do this, perhaps an existing library?
source
share