How to check reflectively in Java if interface extends another interface? I tried this:
for (Class<?> aClass : classes) {
int modifier = aClass.getModifiers();
if (Modifier.isInterface(modifier)) {
if (aClass.getSuperclass() != null && aClass.getSuperclass().equals(TopWorker.class)) {
log.info(aClass.getSimpleName() + " extends abstract " + TopWorker.class.getSimpleName());
}
}
}
Check for Superclass is not working (interface is not a class) Thanks
Aucun commentaire:
Enregistrer un commentaire