Exemplo n.º 1
0
 private boolean implementsInterface(final ClassMetadata other) {
   if (this == other) {
     return true;
   }
   for (ClassMetadata c = this; c != null; c = c.getSuperclass()) {
     for (final ClassMetadata in : c.getInterfaces()) {
       if (in.type.equals(other.type) || in.implementsInterface(other)) {
         return true;
       }
     }
   }
   return false;
 }
Exemplo n.º 2
0
 public boolean isAssignableFrom(final ClassMetadata other) {
   return this == other
       || other.implementsInterface(this)
       || other.isSubclassOf(this)
       || (other.isInterface() && this.type.getDescriptor().equals("Ljava/lang/Object;"));
 }