Class Validator.InvalidValueException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.vaadin.featurepack.data.Validator.InvalidValueException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FDateField.UnparsableDateString, FieldGroup.FieldGroupInvalidValueException, Validator.EmptyValueException
Enclosing interface:
Validator

public static class Validator.InvalidValueException extends RuntimeException
Exception that is thrown by a Validator when a value is invalid.

The default implementation of InvalidValueException does not support HTML in error messages. To enable HTML support, override getHtmlMessage() and use the subclass in validators.

Since:
3.0
Author:
Vaadin Ltd.
See Also:
  • Constructor Details

    • InvalidValueException

      public InvalidValueException(String message)
      Constructs a new InvalidValueException with the specified message.
      Parameters:
      message - The detail message of the problem.
    • InvalidValueException

      public InvalidValueException(String message, Validator.InvalidValueException... causes)
      Constructs a new InvalidValueException with a set of causing validation exceptions. The causing validation exceptions are included when the exception is painted to the client.
      Parameters:
      message - The detail message of the problem.
      causes - One or more InvalidValueExceptions that caused this exception.
  • Method Details

    • isInvisible

      public boolean isInvisible()
      Check if the error message should be hidden. An empty (null or "") message is invisible unless it contains nested exceptions that are visible.
      Returns:
      true if the error message should be hidden, false otherwise
    • getHtmlMessage

      public String getHtmlMessage()
      Returns the message of the error in HTML. Note that this API may change in future versions.
    • getCauses

      public Validator.InvalidValueException[] getCauses()
      Returns the InvalidValueExceptions that caused this exception.
      Returns:
      An array containing the InvalidValueExceptions that caused this exception. Returns an empty array if this exception was not caused by other exceptions.