org.beanfabrics
Class ValidatableBean

java.lang.Object
  extended by org.beanfabrics.AbstractBean
      extended by org.beanfabrics.ValidatableBean
All Implemented Interfaces:
Bean, Validatable
Direct Known Subclasses:
AbstractPM

public class ValidatableBean
extends AbstractBean
implements Validatable

This is an implementation of Validatable that uses a Validator for producing a fresh ValidationState.

Author:
Michael Karneim

Constructor Summary
ValidatableBean()
          Constructs a new instance.
 
Method Summary
 ValidationState getValidationState()
          Returns the current validation state of this object.
 Validator getValidator()
          Returns the Validator of this validatable object.
 boolean isValid()
          Returns true if this object is valid.
 void revalidate()
          Updates the validation state of this object.
protected  void setValidationState(ValidationState validationState)
          Replaces the validation state.
 
Methods inherited from class org.beanfabrics.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, equals, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatableBean

public ValidatableBean()
Constructs a new instance.

Method Detail

revalidate

public void revalidate()
Updates the validation state of this object.

Specified by:
revalidate in interface Validatable

getValidationState

public final ValidationState getValidationState()
Returns the current validation state of this object.

Specified by:
getValidationState in interface Validatable
Returns:
the current validation state of this object

isValid

public final boolean isValid()
Returns true if this object is valid. This object is valid if it's validation state is null.

Specified by:
isValid in interface Validatable
Returns:
true if this object is valid

getValidator

public final Validator getValidator()
Returns the Validator of this validatable object.

Specified by:
getValidator in interface Validatable
Returns:
the Validator of this validatable object

setValidationState

protected final void setValidationState(ValidationState validationState)
Replaces the validation state. This method should not be called directly since it is called from the revalidate() method.



© 2010 by Michael Karneim, http://www.beanfabrics.org