Exemplo n.º 1
0
 private void addToAllValidIfNeeded(E element) {
   if (allValid != null) {
     if (element instanceof Property<?>) {
       allValid.add((Property<?>) element);
     } else if (element instanceof Model) {
       allValid.add(((Model) element).allValid());
     }
   }
 }
Exemplo n.º 2
0
 /**
  * @return a property that, if we contain properties or models, will be true if all contains
  *     properties/models (as well as ourself) are valid.
  */
 public Property<Boolean> allValid() {
   if (allValid == null) {
     allValid = new PropertyGroup(getValueObject().getName() + ".allValid");
     allValid.add(this);
     for (E element : getDirect()) {
       addToAllValidIfNeeded(element);
     }
   }
   return allValid;
 }