Example #1
0
  /**
   * 入力情報の検証を行う.
   *
   * @return 検証結果
   */
  @Override
  public ValidateErrors validate() {

    final ValidateErrors errors = new ValidateErrors();

    if (isRequiredError()) {

      errors.add(new ValidateError(ErrorInfo.Required, requiredSetting.label()));
    }

    if (isMaxLengthError()) {

      final Object[] messageParam = {maxLengthSetting.label(), maxLengthSetting.value()};
      errors.add(new ValidateError(ErrorInfo.MaxLengthOver, messageParam));
    }

    if (isValidCharcterError()) {

      errors.add(new ValidateError(ErrorInfo.InvalidCharacters, validCharSetting.label()));
    }

    return errors;
  }