Enum Class Validation

java.lang.Object
java.lang.Enum<Validation>
limn.components.Validation
All Implemented Interfaces:
Serializable, Comparable<Validation>, Constable

public enum Validation extends Enum<Validation>
What an application has decided about the value a control holds: nothing yet, wrong, doubtful, accepted, or worth a note. The application decides it, in a handler or a watcher, and the toolkit shows it: on the border of a TextField or a TextArea, and, around any control, a Field's border, its line under the control and what a screen reader is told.

Only ERROR reaches a reader as a state: each platform has one flag for a value that failed validation and none for the other three, and a field that passed announced as failing would be the wrong fact. The message a Field shows says the rest, as the control's description.

A 1.x minor release may add constants to this enum: a switch over it needs a default branch.

  • Enum Constant Details

    • NONE

      public static final Validation NONE
      Nothing has been decided, or the decision was taken back: the control draws as it rests.
    • ERROR

      public static final Validation ERROR
      The value is refused; drawn in the theme's danger colour.
    • WARNING

      public static final Validation WARNING
      The value is taken with a doubt; drawn in the theme's warning colour.
    • SUCCESS

      public static final Validation SUCCESS
      The value is accepted; drawn in the theme's success colour.
    • INFO

      public static final Validation INFO
      The value carries a note; drawn in the theme's info colour.
  • Method Details

    • values

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

      public static Validation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null