/** * @param classNode the class node for the interface * @return true if this class declares that it implements the given interface * or if one of its interfaces extends directly or indirectly the interface */ public boolean declaresInterface(ClassNode classNode) { ClassNode[] interfaces = redirect().getInterfaces(); if (declaresInterfaceDirect(interfaces, classNode)) return true; List superInterfaces = Arrays.asList(interfaces); while (superInterfaces.size() > 0) { List keep = new ArrayList(); for (int i = 0; i < superInterfaces.size(); i++) { ClassNode cn = (ClassNode) superInterfaces.get(i); if (cn.declaresInterface(classNode)) return true; keep.addAll(Arrays.asList(cn.getInterfaces())); } superInterfaces = keep; } return false; }
/** * @param classNode the class node for the interface * @return true if this class declares that it implements the given interface * or if one of its interfaces extends directly or indirectly the interface */ public boolean declaresInterface(ClassNode classNode) { ClassNode[] interfaces = redirect().getInterfaces(); if (declaresInterfaceDirect(interfaces, classNode)) return true; List superInterfaces = Arrays.asList(interfaces); while (superInterfaces.size() > 0) { List keep = new ArrayList(); for (int i = 0; i < superInterfaces.size(); i++) { ClassNode cn = (ClassNode) superInterfaces.get(i); if (cn.declaresInterface(classNode)) return true; keep.addAll(Arrays.asList(cn.getInterfaces())); } superInterfaces = keep; } return false; }
/** * @param classNode the class node for the interface * @return true if this class declares that it implements the given interface * or if one of its interfaces extends directly or indirectly the interface */ public boolean declaresInterface(ClassNode classNode) { ClassNode[] interfaces = redirect().getInterfaces(); if (declaresInterfaceDirect(interfaces, classNode)) return true; List superInterfaces = Arrays.asList(interfaces); while (superInterfaces.size() > 0) { List keep = new ArrayList(); for (int i = 0; i < superInterfaces.size(); i++) { ClassNode cn = (ClassNode) superInterfaces.get(i); if (cn.declaresInterface(classNode)) return true; keep.addAll(Arrays.asList(cn.getInterfaces())); } superInterfaces = keep; } return false; }