Interface Validator<T>

All Known Implementing Classes:
AbstractValidator, BoundValidator, IndexValidators, StringValidators

public interface Validator<T>
Validator that can validate some aspect of a component's model, and indicate problems to the user.

Note that the enum StringValidators provides many built-in validators to perform common tasks.

Author:
Tim Boudreau
  • Method Summary

    Modifier and Type
    Method
    Description
    The type of the model object which can be validated.
    void
    validate(Problems problems, String compName, T model)
    Validate the passed model.
  • Method Details

    • validate

      void validate(Problems problems, String compName, T model)
      Validate the passed model. If the component is invalid, this method shall add problems to the passed list.
      Parameters:
      problems - A list of problems.
      compName - The name of the component in question (may be null in some cases)
      model - The model in question
    • modelType

      Class<T> modelType()
      The type of the model object which can be validated. Necessary due to limitations of the Java implementation of generics, so that model conversions can be done at runtime, and declaratively registered ValidationListeners can be matched with Validator types.

      The return value of this method is expected to remain constant throughout the life of this validator.

      Returns:
      The type of the model object expected. Note that a validator may be passed a subclass of this type.