public interface ValidationMessage
Definition of an interface describing a validation message.
If a Validator
cannot successfully validate an input field, it
creates a ValidationResult
object that not only indicates the
validation error, but also contains corresponding error messages to be
displayed to the user. These error messages are represented by this
interface.
The idea behind this interface is that there can be multiple ways of obtaining the error message for the user. For instance it can be directly specified as text or loaded from the application's resources. By making use of an interface the actual source of the message is transparent for the client.
A validation message consists of a text that can be directly displayed to the user. This text should be informative, so that the user knows what is wrong and how it can be fixed. The default validators shipped with this framework are able to provide meaningful error messages. In addition to the text, a validation message also contains a unique key. The existing validator implementations document the error keys they can produce. Further, a level for the severity of the message can be specified. The level determines whether the message is considered an error or not.
Modifier and Type | Method and Description |
---|---|
String |
getKey()
Returns the key of this validation message.
|
ValidationMessageLevel |
getLevel()
Returns the
ValidationMessageLevel associated with this message. |
String |
getMessage()
Returns the actual message.
|
String getKey()
ValidationMessageLevel getLevel()
ValidationMessageLevel
associated with this message.
This level determines the severity of this message.ValidationMessageLevel
String getMessage()
Copyright © 2016 The JGUIraffe Team. All rights reserved.