Schnittstelle Validator<T>

Alle bekannten Implementierungsklassen:
BigDecimalValidator, BooleanValidator, DateRangeValidator, DateStringValidator, DefaultValidator, DoubleValidator, FileValidator, FloatValidator, IntegerRangeValidator, IntegerValidator, LongValidator, NumberValidator, ShortValidator, StringValidator

public interface Validator<T>
Validator api.
Version:
$Id$
Autor:
John McNally, Thomas Vandahl
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    static final String
    "flexible" Rule, used in DateFormat Validator
    static final String
    "format" Rule, used in DateFormat Validator
    static final String
    "invalidNumber" Rule, used in the various Number Validators
    static final String
    "mask" Rule, used in StringValidator
    static final String
    "maxLength" Rule, used in all validators
    static final String
    "maxValue" Rule, used in the various Number Validators
    static final String
    "minLength" Rule, used in all validators
    static final String
    "minValue" Rule, used in the various Number Validators
    static final String
    "required" Rule, used in all validators
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    Determine whether a testValue meets the criteria specified in the constraints defined for this validator
    void
    Determine whether a field meets the criteria specified in the constraints defined for this validator
    Get the last error message resulting from invalid input.
    boolean
    isValid(String testValue)
    Veraltet.
    use isValid(Field) instead
    boolean
    isValid(Field<T> field)
    Determine whether a field meets the criteria specified in the constraints defined for this validator
  • Felddetails

    • FLEXIBLE_RULE_NAME

      static final String FLEXIBLE_RULE_NAME
      "flexible" Rule, used in DateFormat Validator
      Siehe auch:
    • FORMAT_RULE_NAME

      static final String FORMAT_RULE_NAME
      "format" Rule, used in DateFormat Validator
      Siehe auch:
    • INVALID_NUMBER_RULE_NAME

      static final String INVALID_NUMBER_RULE_NAME
      "invalidNumber" Rule, used in the various Number Validators
      Siehe auch:
    • MASK_RULE_NAME

      static final String MASK_RULE_NAME
      "mask" Rule, used in StringValidator
      Siehe auch:
    • MAX_LENGTH_RULE_NAME

      static final String MAX_LENGTH_RULE_NAME
      "maxLength" Rule, used in all validators
      Siehe auch:
    • MAX_VALUE_RULE_NAME

      static final String MAX_VALUE_RULE_NAME
      "maxValue" Rule, used in the various Number Validators
      Siehe auch:
    • MIN_LENGTH_RULE_NAME

      static final String MIN_LENGTH_RULE_NAME
      "minLength" Rule, used in all validators
      Siehe auch:
    • MIN_VALUE_RULE_NAME

      static final String MIN_VALUE_RULE_NAME
      "minValue" Rule, used in the various Number Validators
      Siehe auch:
    • REQUIRED_RULE_NAME

      static final String REQUIRED_RULE_NAME
      "required" Rule, used in all validators
      Siehe auch:
  • Methodendetails

    • isValid

      boolean isValid(Field<T> field)
      Determine whether a field meets the criteria specified in the constraints defined for this validator
      Parameter:
      field - a Field to be tested
      Gibt zurück:
      true if valid, false otherwise
    • assertValidity

      void assertValidity(Field<T> field) throws ValidationException
      Determine whether a field meets the criteria specified in the constraints defined for this validator
      Parameter:
      field - a Field to be tested
      Löst aus:
      ValidationException - containing an error message if the testValue did not pass the validation tests.
    • isValid

      boolean isValid(String testValue)
      Veraltet.
      use isValid(Field) instead
      Determine whether a testValue meets the criteria specified in the constraints defined for this validator
      Parameter:
      testValue - a String to be tested
      Gibt zurück:
      true if valid, false otherwise
    • assertValidity

      void assertValidity(String testValue) throws ValidationException
      Determine whether a testValue meets the criteria specified in the constraints defined for this validator
      Parameter:
      testValue - a String to be tested
      Löst aus:
      ValidationException - containing an error message if the testValue did not pass the validation tests.
    • getMessage

      String getMessage()
      Get the last error message resulting from invalid input.
      Gibt zurück:
      a String message, or the empty String "".