Package org.biojava.utils
Class ChangeListener.AlwaysVetoListener
java.lang.Object
org.biojava.utils.ChangeListener.AlwaysVetoListener
- All Implemented Interfaces:
EventListener
,ChangeListener
- Enclosing interface:
ChangeListener
An implementation that always vetoes everything.
- Since:
- 1.1
- Author:
- Thomas Down, Matthew Pocock
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojava.utils.ChangeListener
ChangeListener.AlwaysVetoListener, ChangeListener.ChangeEventRecorder, ChangeListener.LoggingListener
-
Field Summary
Fields inherited from interface org.biojava.utils.ChangeListener
ALWAYS_VETO, LOG_TO_OUT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
postChange
(ChangeEvent cev) Called when a change has just taken place.void
preChange
(ChangeEvent cev) Called before a change takes place.
-
Constructor Details
-
AlwaysVetoListener
protected AlwaysVetoListener()Private constructor.
-
-
Method Details
-
preChange
Description copied from interface:ChangeListener
Called before a change takes place.
This is your chance to stop the change by throwing a ChangeVetoException. This method does not indicate that the change will definitely take place, so it is not recomended that you take any positive action within this handler.
- Specified by:
preChange
in interfaceChangeListener
- Parameters:
cev
- An event encapsulating the change which is about to take place.- Throws:
ChangeVetoException
- Description of ExceptionChangeVetoException
- if the receiver does not wish this change to occur at this time.
-
postChange
Description copied from interface:ChangeListener
Called when a change has just taken place.
This method is the place to perform any behavior in response to the change event.
- Specified by:
postChange
in interfaceChangeListener
- Parameters:
cev
- An event encapsulating the change which has occured.- Throws:
AssertionFailure
- if this is called, as preChange should have vetoed any change already
-