Пример #1
0
 private Constraint addInterfaceConstraint(ReflectClass claxx) {
   Collection4 classes = stream().classCollection().forInterface(claxx);
   if (classes.size() == 0) {
     QConClass qcc = new QConClass(_trans, null, null, claxx);
     addConstraint(qcc);
     return qcc;
   }
   Iterator4 i = classes.iterator();
   Constraint constr = null;
   while (i.moveNext()) {
     ClassMetadata classMetadata = (ClassMetadata) i.current();
     ReflectClass classMetadataClaxx = classMetadata.classReflector();
     if (classMetadataClaxx != null) {
       if (!classMetadataClaxx.isInterface()) {
         if (constr == null) {
           constr = constrain(classMetadataClaxx);
         } else {
           constr = constr.or(constrain(classMetadata.classReflector()));
         }
       }
     }
   }
   return constr;
 }
Пример #2
0
  private Constraint addClassConstraint(ReflectClass claxx) {
    if (isTheObjectClass(claxx)) {
      return null;
    }

    if (claxx.isInterface()) {
      return addInterfaceConstraint(claxx);
    }

    final Collection4 newConstraints = introduceClassConstrain(claxx);
    if (newConstraints.isEmpty()) {
      QConClass qcc = new QConClass(_trans, claxx);
      addConstraint(qcc);
      return qcc;
    }

    return toConstraint(newConstraints);
  }
Пример #3
0
 private boolean isTheObjectClass(ReflectClass claxx) {
   return claxx.equals(stream()._handlers.ICLASS_OBJECT);
 }