Package com.vaadin.data
Class Validator.InvalidValueException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.vaadin.data.Validator.InvalidValueException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DateField.UnparsableDateString
,FieldGroup.FieldGroupInvalidValueException
,Validator.EmptyValueException
- Enclosing interface:
- Validator
public static class Validator.InvalidValueException extends RuntimeException
Exception that is thrown by aValidator
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InvalidValueException(String message)
Constructs a newInvalidValueException
with the specified message.InvalidValueException(String message, Validator.InvalidValueException... causes)
Constructs a newInvalidValueException
with a set of causing validation exceptions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Validator.InvalidValueException[]
getCauses()
Returns theInvalidValueExceptions
that caused this exception.String
getHtmlMessage()
Returns the message of the error in HTML.boolean
isInvisible()
Check if the error message should be hidden.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
InvalidValueException
public InvalidValueException(String message)
Constructs a newInvalidValueException
with the specified message.- Parameters:
message
- The detail message of the problem.
-
InvalidValueException
public InvalidValueException(String message, Validator.InvalidValueException... causes)
Constructs a newInvalidValueException
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 moreInvalidValueException
s that caused this exception.
-
-
Method Detail
-
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 theInvalidValueExceptions
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.
-
-