Enum IndexValidators

java.lang.Object
java.lang.Enum<IndexValidators>
org.netbeans.validation.api.builtin.indexvalidation.IndexValidators
All Implemented Interfaces:
Serializable, Comparable<IndexValidators>, java.lang.constant.Constable, Validator<Integer[]>

public enum IndexValidators extends Enum<IndexValidators> implements Validator<Integer[]>
An enumeration of validator factories for commonly needed forms of selection validaton. This is useful for validating the user selection in components such as a JList or a number of AbstractButtons.
Author:
Tim Boudreau, Hugo Heden
  • Enum Constant Details

    • REQUIRE_SELECTION

      public static final IndexValidators REQUIRE_SELECTION
  • Method Details

    • values

      public static IndexValidators[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static IndexValidators valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • validate

      public void validate(Problems problems, String compName, Integer[] model)
      Description copied from interface: Validator
      Validate the passed model. If the component is invalid, this method shall add problems to the passed list.
      Specified by:
      validate in interface Validator<Integer[]>
      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

      public Class<Integer[]> modelType()
      Description copied from interface: Validator
      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.

      Specified by:
      modelType in interface Validator<Integer[]>
      Returns:
      The type of the model object expected. Note that a validator may be passed a subclass of this type.