| java.lang.Object com.jgoodies.validation.message.AbstractValidationMessage
All known Subclasses: com.jgoodies.validation.message.PropertyValidationMessage, com.jgoodies.validation.message.SimpleValidationMessage,
AbstractValidationMessage | abstract public class AbstractValidationMessage implements ValidationMessage,Serializable(Code) | | An abstract class that minimizes the effort required to implement the
ValidationMessage interface. Holds the severity, a text message,
and the association key.
Subclasses should implement #equals and #hashCode
to prevent unnecessary change notifications for the result property
when a ValidationResultModel gets a new ValidationResult. See for example
the implementation of method
PropertyValidationMessage.equals(Object) .
author: Karsten Lentzsch version: $Revision: 1.7 $ |
Method Summary | |
public String | formattedText() Returns a message description as formatted text. | public Object | key() Returns this message's association key that can be used to model
a loose coupling between validation messages and views that present
the validated data.
Subclasses may override this method to return keys that are built from
other internal data. | final protected void | setKey(Object associationKey) Sets the given object as new association key. | final public Severity | severity() Returns this message's severity, either error or warning. | final protected String | text() Returns this validation message's text. | public String | toString() Returns a string representation of this validation message. |
AbstractValidationMessage | protected AbstractValidationMessage(String text, Severity severity)(Code) | | Constructs an AbstractValidationMessage for the given text and Severity.
Parameters: text - describes this message Parameters: severity - this message's severity, either error or warning throws: IllegalArgumentException - if severity is Severity.OK |
AbstractValidationMessage | protected AbstractValidationMessage(String text, Severity severity, Object key)(Code) | | Constructs an AbstractValidationMessage for the given text,
Severity, and association key.
Parameters: text - describes this message Parameters: severity - this message's severity, either error or warning Parameters: key - used to determine whether this message belongsto a given view throws: IllegalArgumentException - if severity is Severity.OK |
formattedText | public String formattedText()(Code) | | Returns a message description as formatted text. This default
implementation just returns the message text.
Subclasses may override to add information about the type and
other message related information.
a message description as formatted text |
key | public Object key()(Code) | | Returns this message's association key that can be used to model
a loose coupling between validation messages and views that present
the validated data.
Subclasses may override this method to return keys that are built from
other internal data. For example, the
PropertyValidationMessage returns the aspect as key.
See the class comment for more information about this relation.
this message's association key |
setKey | final protected void setKey(Object associationKey)(Code) | | Sets the given object as new association key.
Parameters: associationKey - the key to be set |
severity | final public Severity severity()(Code) | | Returns this message's severity, either error or warning.
message's severity, either error or warning |
text | final protected String text()(Code) | | Returns this validation message's text.
the message text |
toString | public String toString()(Code) | | Returns a string representation of this validation message.
Prints the class name and the formatted text.
a string representation of this validation message See Also: Object.toString |
|
|