public interface ValidationResultModel
extends com.jgoodies.common.bean.ObservableBean2
ValidationResult
and provides bound
read-only properties for the result, severity, error and messages state.DefaultValidationResultModel
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_ERRORS
The name of the bound property that indicates whether there are errors.
|
static String |
PROPERTY_MESSAGES
The name of the bound property that indicates whether there are messages.
|
static String |
PROPERTY_RESULT
The name of the bound property for the validation result.
|
static String |
PROPERTY_SEVERITY
The name of the bound property for the validation result severity.
|
Modifier and Type | Method and Description |
---|---|
ValidationResult |
getResult()
Returns this model's validation result which must be non-null.
|
Severity |
getSeverity()
Looks up and returns the Severity of this model's validation result,
one of
Severity.ERROR , Severity.WARNING ,
or Severity.OK . |
boolean |
hasErrors()
Checks and answers whether this model's validation result has errors.
|
boolean |
hasMessages()
Checks and answers whether this model's validation result has messages.
|
void |
setResult(ValidationResult newResult)
Sets a new non-null validation result and notifies all registered
listeners, if the result changed.
|
static final String PROPERTY_RESULT
getResult()
,
Constant Field Valuesstatic final String PROPERTY_SEVERITY
getSeverity()
,
Constant Field Valuesstatic final String PROPERTY_ERRORS
hasErrors()
,
Constant Field Valuesstatic final String PROPERTY_MESSAGES
hasMessages()
,
Constant Field ValuesValidationResult getResult()
setResult(ValidationResult)
void setResult(ValidationResult newResult)
#validate()
method.
Implementors shall throw a NullPointerException if the new result
is null
. It is recommended that implementors prevent
modifications of the given ValidationResult by using an internal
and unmodifiable copy.
newResult
- the validation result to be setgetResult()
Severity getSeverity()
Severity.ERROR
, Severity.WARNING
,
or Severity.OK
.hasErrors()
,
hasMessages()
boolean hasErrors()
getSeverity()
,
hasMessages()
boolean hasMessages()
getSeverity()
,
hasErrors()
Copyright © 2003-2014 JGoodies Software GmbH. All Rights Reserved.