org.zaval.util
Class ValidationObject

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
All Implemented Interfaces:
Validationable
Direct Known Subclasses:
LwCanvas, LwView, LwViewMan, PosController

public abstract class ValidationObject
extends java.lang.Object
implements Validationable

This abstract class is implementation of the Validationable interface that can be inherited with other classes. It is necessary to implement recalc method of the class, the method will be executed when the the validation process has been performed with validate method and the object is not valid. It means that the implementation guarantees that recalc method will be executed only if it is realy necessary.


Field Summary
protected  boolean isValidFlag
           
 
Constructor Summary
ValidationObject()
           
 
Method Summary
 void invalidate()
          Invalidates this object.
 boolean isValid()
          Checks if this object is valid.
protected abstract  void recalc()
          Invoked with validate method in a case if the object is not valid.
 void validate()
          Validates this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isValidFlag

protected boolean isValidFlag
Constructor Detail

ValidationObject

public ValidationObject()
Method Detail

invalidate

public void invalidate()
Description copied from interface: Validationable
Invalidates this object.
Specified by:
invalidate in interface Validationable

validate

public void validate()
Description copied from interface: Validationable
Validates this object.
Specified by:
validate in interface Validationable

isValid

public boolean isValid()
Description copied from interface: Validationable
Checks if this object is valid.
Specified by:
isValid in interface Validationable
Following copied from interface: org.zaval.util.Validationable
Returns:
a valid state of the object. The object is valid if the method returns true.

recalc

protected abstract void recalc()
Invoked with validate method in a case if the object is not valid.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org