コード例 #1
0
  /**
   * A method to append a validation response to this validation response. The errors list and
   * warnings list are simply appended, and the isValid is logically AND-ed and isModified is
   * logically OR-ed.
   */
  public void append(ValidationResponse validationResponse) {
    for (ValidationMessage msg : validationResponse.getValidationErrors()) {
      if (getValidationError(msg.getKey()) != null) {
        msg.setKey(msg.getKey() + "(" + key++ + ")");
      }

      addValidationError(msg);
    }

    for (ValidationMessage msg : validationResponse.getValidationWarnings()) {
      if (getValidationWarning(msg.getKey()) != null) {
        msg.setKey(msg.getKey() + "(" + key++ + ")");
      }

      addValidationWarning(msg);
    }

    setValid(isValid() && validationResponse.isValid());

    setModified(isModified() || validationResponse.isModified());
  }
コード例 #2
0
  public void addValidationWarning(String message) {
    ValidationMessage e = new ValidationMessage(String.valueOf(key++), message);

    addValidationWarning(e);
  }