static final boolean | isAbstractInterface(java.lang.Class cl)Return true, iff,
1. 'cl' is an interface, and
2. 'cl' and all its ancestors do not implement java.rmi.Remote, and
3. if 'cl' has no methods (including those of its ancestors), or,
if all the methods (including those of its ancestors) throw an
exception that is atleast java.rmi.RemoteException or one of
java.rmi.RemoteException's super classes.
if (!cl.isInterface() || // #1
java.rmi.Remote.class.isAssignableFrom(cl)) { // #2
return false;
}
Method[] methods = cl.getMethods();
for (int i = 0; i < methods.length; i++) {
Class exceptions[] = methods[i].getExceptionTypes();
boolean exceptionMatch = false;
for (int j = 0; (j < exceptions.length) && !exceptionMatch; j++) {
if ((java.rmi.RemoteException.class == exceptions[j]) ||
(java.lang.Throwable.class == exceptions[j]) ||
(java.lang.Exception.class == exceptions[j]) ||
(java.io.IOException.class == exceptions[j])) {
exceptionMatch = true;
}
}
if (!exceptionMatch) {
return false;
}
}
return true;
|