Example #1
0
 private ClassMetadata singleClassConstraint() {
   if (requiresSort()) {
     return null;
   }
   QConClass clazzconstr = classConstraint();
   if (clazzconstr == null) {
     return null;
   }
   ClassMetadata clazz = clazzconstr._classMetadata;
   if (clazz == null) {
     return null;
   }
   if (clazzconstr.hasChildren() || clazz.isArray()) {
     return null;
   }
   return clazz;
 }
Example #2
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;
 }