Определение расширенных интерфейсов класса
Мне нужно определить, расширяет ли объект Class, представляющий интерфейс, другой интерфейс, то есть:
package a.b.c.d;
public Interface IMyInterface extends a.b.d.c.ISomeOtherInterface{
}
в соответствии сспецификация Class.getSuperClass () вернет ноль для интерфейса.
If this Class represents either the Object class, an interface, a primitive type, or void, then null is returned.
Следовательно, следующее не сработает.
Class interface = Class.ForName("a.b.c.d.IMyInterface")
Class extendedInterface = interface.getSuperClass();
if(extendedInterface.getName().equals("a.b.d.c.ISomeOtherInterface")){
//do whatever here
}
есть идеи?