Class ValidatorException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.commons.validator.ValidatorException
All Implemented Interfaces:
Serializable

public class ValidatorException extends Exception
The base exception for the Validator Framework. All other Exceptions thrown during calls to Validator.validate() are considered errors.
See Also:
  • Field Details

    • START_WITH_INVALID

      public static final String START_WITH_INVALID
      Common prefix for messages, f.i. "Invalid Code ...", "Invalid Character ..."
      See Also:
  • Constructor Details

    • ValidatorException

      public ValidatorException()
      Constructs an Exception with no specified detail message.
    • ValidatorException

      public ValidatorException(String message)
      Constructs an Exception with the specified detail message.
      Parameters:
      message - The error message.
  • Method Details

    • invalidCode

      public static final String invalidCode(String code)
      Convenient message text "Invalid code [invalidCode]." with no additional information
      Parameters:
      code - the invalid code
      Returns:
      the message text
    • invalidCode

      public static final String invalidCode(String code, String detail)
      Convenient message text "Invalid code [invalidCode], additional information", f.i. Invalid code "", too short
      Parameters:
      code - the invalid code
      detail - optional additional information
      Returns:
      the message text