Пример #1
0
  /**
   * Method parseLogicAnd.
   *
   * @param n Element
   * @return Condition
   */
  private Condition parseLogicAnd(Element n) {
    ConditionLogicAnd cond = new ConditionLogicAnd();

    for (Iterator<Element> iterator = n.elementIterator(); iterator.hasNext(); ) {
      Element condElement = iterator.next();
      cond.add(parseCond(condElement));
    }

    if ((cond._conditions == null) || (cond._conditions.length == 0)) {
      error("Empty <and> condition in " + getCurrentFileName());
    }

    return cond;
  }
Пример #2
0
  /**
   * Method joinAnd.
   *
   * @param cond Condition
   * @param c Condition
   * @return Condition
   */
  private Condition joinAnd(Condition cond, Condition c) {
    if (cond == null) {
      return c;
    }

    if (cond instanceof ConditionLogicAnd) {
      ((ConditionLogicAnd) cond).add(c);
      return cond;
    }

    ConditionLogicAnd and = new ConditionLogicAnd();
    and.add(cond);
    and.add(c);
    return and;
  }