Class AbstractEventConstraint

All Implemented Interfaces:
Constraint, EntityValue, EventConstraint, Serializable
Direct Known Subclasses:
AndEventConstraint, EventContainsEntityConstraint, EventTypeIsConstraint, NotEventConstraint, OrEventConstraint

public abstract class AbstractEventConstraint
extends Object
implements EventConstraint

This class is an abstract EventConstraint class. It implements the EventConstraint interface located in org.datamanager.constraint, and provides a public describes() method, which is exactly the same as the public abstract accepts() method in EventConstriant. Every EventConstraint should ideally extend this class instead of implementing EventConstraint themselves. By doing so the constraint will gain extra power while working with Entities in the kernel. For example, a when a constraint is working on an Entity, calling methods such as getValue() and getAttributes(), it should not cause DataManagerEvents to be fired. If the constriant is a subclass of AbstractConstraint then no events will be fired, otherwise events will. If a constraint has already been written to implement EventConstraint it can easily be modified to use this class instead simply by changing implements EventConstraint to extends AbstractEventConstraint and renaming the accepts() method to describes().

$Revision: 1.9 $
Matthew Farrellee
See Also:
EntityConstraint, DataManagerEvent, Serialized Form

Field Summary
Fields inherited from interface org.datamanager.constraint.EventConstraint
Constructor Summary
Method Summary
 boolean accepts(DataManagerEvent event)
          The accepts() method required by the EventConstraint interface.
protected abstract  boolean describes(DataManagerEvent event)
          The method required by this class.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final String DEBUG_ACCEPTS_MESSAGE
See Also:
Constant Field Values
Constructor Detail


public AbstractEventConstraint()
Method Detail


public final boolean accepts(DataManagerEvent event)
                      throws DataManagerException
The accepts() method required by the EventConstraint interface. This class implements this method and makes it final, so no subclasses can override the work that is done by this class. Eventually this accepts() method will call the describes() method that should be implemented by subclasses.

Specified by:
accepts in interface EventConstraint
event - An event to check.
Whether the event is acceptable or not.


protected abstract boolean describes(DataManagerEvent event)
                              throws DataManagerException
The method required by this class. This method has the exact same semantics as the interface EventConstraint's accepts() method.

event - An entity to check.
Whether the event is acceptable or not.

See the Helium Website