net.israfil.foundation.valuemodel
Interface Vetoable

All Known Subinterfaces:
MutableValue<E>
All Known Implementing Classes:
ValueHolder

public interface Vetoable

An interface for objects that can notify observers of changes to itself before the change. The objects thus notified can veto the change. The specific behaviour for vetoing is undefined and is dependent upon the particular implementation of the vetoable object and its vetoers. The changing object should call the provided callback signature, with the parameter being the object that was changed in its new state. The vetoer is responsible for knowing what it needs to know in order to validate or veto the change.

Version:
$Revision: 129 $
Author:
Christian Edward Gruber, Latest: $Author: cgruber $

Method Summary
 void addVetoers(java.lang.String callback, java.lang.Object... approvers)
          Add one or more vetoers to this object, with a callback method spec that will be invoked upon a data change.
 void removeVetoers(java.lang.Object... approvers)
          Remove one or more vetoers from vetoable object.
 

Method Detail

addVetoers

void addVetoers(java.lang.String callback,
                java.lang.Object... approvers)
Add one or more vetoers to this object, with a callback method spec that will be invoked upon a data change. The callback method should contain two parameters. The first is the notification source (the holder or whatever) and the new value. It also should return a boolean.


removeVetoers

void removeVetoers(java.lang.Object... approvers)
Remove one or more vetoers from vetoable object.



Copyright © 2006-2008. All Rights Reserved.