Enum Severity

java.lang.Object
java.lang.Enum<Severity>
org.netbeans.validation.api.Severity
All Implemented Interfaces:
Serializable, Comparable<Severity>, java.lang.constant.Constable

public enum Severity extends Enum<Severity>
enum indicating Severity, used for classifying Problem instances.
Author:
Tim Boudreau
  • Enum Constant Details

    • INFO

      public static final Severity INFO
      An information message for the user, which should not block them from proceeding but may provide advice
    • WARNING

      public static final Severity WARNING
      A warning to the user that they should change a value, but which does not block them from proceeding
    • FATAL

      public static final Severity FATAL
      A fatal problem with user input which must be corrected
  • Method Details

    • values

      public static Severity[] 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 Severity 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
    • image

      public BufferedImage image()
      Get a warning icon as an image
      Returns:
      An image
    • icon

      public Icon icon()
      Get an icon version of the warning image
      Returns:
      An icon
    • color

      public Color color()
      Get a suitable color for displaying problem text
      Returns:
      A color
    • badge

      public BufferedImage badge()
    • describeError

      public String describeError(String toDescribe)
      Annotate an error description with the severity. Used for providing accessible descriptions for error components.
      Parameters:
      toDescribe -
      Returns:
    • toString

      public String toString()
      Returns a localized name for this enum constant
      Overrides:
      toString in class Enum<Severity>
      Returns:
      A localized name