コード例 #1
0
 /** Get other errors, not in the given tags. */
 protected Set getOtherErrors(Set excludes) {
   Set errors = SCollection.createLinkedHashSet();
   Tuple[] elements = getElements();
   for (int i = 0; i < elements.length; i++) {
     boolean excluded = false;
     for (int j = 0; !excluded && j < elements[i].getEntities().length; j++) {
       Object se = elements[i].getEntity(j);
       Object obj = getPathElementObject(se);
       if (obj != null) {
         excluded = excludes.contains(obj);
       }
     }
     if (!excluded) {
       Object obj = getObject(elements[i]);
       if (obj != null && !errors.contains(obj)) errors.add(obj);
     }
   }
   return errors;
 }
コード例 #2
0
 /** Get elements of the given owner type, which have errors or contain elements with errors. */
 protected Set getOwnedElementErrors(String category) {
   Set errors = SCollection.createLinkedHashSet();
   Tuple[] elements = getElements();
   for (int i = 0; i < elements.length; i++) {
     boolean added = false;
     for (int j = 0; !added && j < elements[i].getEntities().length; j++) {
       Object se = elements[i].getEntity(j);
       Object obj = getPathElementObject(se);
       if (obj != null) {
         added = errors.contains(obj);
         if (!added && isInCategory(obj, category)) {
           errors.add(obj);
           added = true;
         }
       }
     }
   }
   return errors;
 }