public static class ChangeListener.LoggingListener extends Object implements ChangeListener
ChangeListener.AlwaysVetoListener, ChangeListener.ChangeEventRecorder, ChangeListener.LoggingListener
ALWAYS_VETO, LOG_TO_OUT
Constructor and Description |
---|
ChangeListener.LoggingListener(PrintStream out)
Create a LoggingListener that will log all events to 'out'.
|
ChangeListener.LoggingListener(PrintStream out,
String prefix)
Create a LoggingListener that will log all events to 'out' with a prefix.
|
Modifier and Type | Method and Description |
---|---|
void |
postChange(ChangeEvent cev)
Called when a change has just taken place.
|
void |
preChange(ChangeEvent cev)
Called before a change takes place.
|
public ChangeListener.LoggingListener(PrintStream out)
out
- the PrintStream to log events topublic ChangeListener.LoggingListener(PrintStream out, String prefix)
out
- the PrintStream to log events toprefix
- the prefix to attach to each line of the logpublic void preChange(ChangeEvent cev) throws ChangeVetoException
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.
preChange
in interface ChangeListener
cev
- An event encapsulating the change which is about
to take place.ChangeVetoException
- Description of Exceptionpublic void postChange(ChangeEvent cev)
ChangeListener
Called when a change has just taken place.
This method is the place to perform any behavior in response to the change event.
postChange
in interface ChangeListener
cev
- An event encapsulating the change which has
occured.Copyright © 2014 BioJava. All rights reserved.