com.vaadin.data
Class Validator.InvalidValueException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.vaadin.data.Validator.InvalidValueException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DateField.UnparsableDateString, 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
Version:
7.0.0.alpha3
Author:
Vaadin Ltd.
See Also:
Serialized Form

Constructor Summary
Validator.InvalidValueException(String message)
          Constructs a new InvalidValueException with the specified message.
Validator.InvalidValueException(String message, Validator.InvalidValueException[] causes)
          Constructs a new InvalidValueException with a set of causing validation exceptions.
 
Method Summary
 Validator.InvalidValueException[] getCauses()
          Returns the InvalidValueExceptions 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
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Validator.InvalidValueException

public Validator.InvalidValueException(String message)
Constructs a new InvalidValueException with the specified message.

Parameters:
message - The detail message of the problem.

Validator.InvalidValueException

public Validator.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 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 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.


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.