com.jgoodies.validation
Interface ValidationResultModel

All Superinterfaces:
com.jgoodies.common.bean.ObservableBean, com.jgoodies.common.bean.ObservableBean2
All Known Implementing Classes:
AbstractValidationResultModel, DefaultValidationResultModel, DelayedValidationResultModel, LimitedValidationResultModel, ValidationResultModelContainer

public interface ValidationResultModel
extends com.jgoodies.common.bean.ObservableBean2

Describes a model that holds a ValidationResult and provides bound read-only properties for the result, severity, error and messages state.

Since:
1.1
Version:
$Revision: 1.10 $
Author:
Karsten Lentzsch
See Also:
DefaultValidationResultModel

Field Summary
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.
 
Method Summary
 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.
 
Methods inherited from interface com.jgoodies.common.bean.ObservableBean2
addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener
 
Methods inherited from interface com.jgoodies.common.bean.ObservableBean
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

PROPERTY_RESULT

static final String PROPERTY_RESULT
The name of the bound property for the validation result.

See Also:
getResult(), Constant Field Values

PROPERTY_SEVERITY

static final String PROPERTY_SEVERITY
The name of the bound property for the validation result severity.

See Also:
getSeverity(), Constant Field Values

PROPERTY_ERRORS

static final String PROPERTY_ERRORS
The name of the bound property that indicates whether there are errors.

See Also:
hasErrors(), Constant Field Values

PROPERTY_MESSAGES

static final String PROPERTY_MESSAGES
The name of the bound property that indicates whether there are messages.

See Also:
hasMessages(), Constant Field Values
Method Detail

getResult

ValidationResult getResult()
Returns this model's validation result which must be non-null.

Returns:
the current validation result
See Also:
setResult(ValidationResult)

setResult

void setResult(ValidationResult newResult)
Sets a new non-null validation result and notifies all registered listeners, if the result changed. This is typically invoked at the end of the #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.

Parameters:
newResult - the validation result to be set
See Also:
getResult()

getSeverity

Severity getSeverity()
Looks up and returns the Severity of this model's validation result, one of Severity.ERROR, Severity.WARNING, or Severity.OK.

Returns:
the severity of this model's validation result
See Also:
hasErrors(), hasMessages()

hasErrors

boolean hasErrors()
Checks and answers whether this model's validation result has errors.

Returns:
true if the validation result has errors, false otherwise
See Also:
getSeverity(), hasMessages()

hasMessages

boolean hasMessages()
Checks and answers whether this model's validation result has messages.

Returns:
true if the validation result has messages, false otherwise
See Also:
getSeverity(), hasErrors()


Copyright © 2003-2013 JGoodies Software GmbH. All Rights Reserved.