Esempio n. 1
0
 private static void fillInInterfacesAndSuperTypes(
     final Set<MetaClass> set, final MetaClass type) {
   for (final MetaClass iface : type.getInterfaces()) {
     set.add(iface);
     fillInInterfacesAndSuperTypes(set, iface);
   }
   if (type.getSuperClass() != null) {
     fillInInterfacesAndSuperTypes(set, type.getSuperClass());
   }
 }
Esempio n. 2
0
 public static int scoreInterface(final MetaClass parm, final MetaClass arg) {
   if (parm.isInterface()) {
     final MetaClass[] iface = arg.getInterfaces();
     if (iface != null) {
       for (final MetaClass c : iface) {
         if (c == parm) return 1;
         else if (parm.isAssignableFrom(c)) return scoreInterface(parm, arg.getSuperClass());
       }
     }
   }
   return 0;
 }