public class ListenerSpinOver extends Evaluator
SpinOffEvaluator
if their corresponding parameter types are
subinterfaces of java.util.EventListener
. Spin.setDefaultOffEvaluator(new ListenerSpinOver());
Constructor and Description |
---|
ListenerSpinOver()
Constructor.
|
ListenerSpinOver(Evaluator evaluator)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
evaluate(Invocation invocation)
Evaluate the given invocation.
|
protected boolean |
isListener(java.lang.Class type)
Test if the given class is a listener subinterface.
|
protected boolean |
isListenerAdditionOrRemoval(java.lang.reflect.Method method)
Test if the given method is a listener addition or removal.
|
protected java.lang.Object |
spinOver(java.lang.Object object)
Spin-over the given object.
|
public ListenerSpinOver()
public ListenerSpinOver(Evaluator evaluator)
evaluator
- the evaluator to wrappublic void evaluate(Invocation invocation) throws java.lang.Throwable
Evaluator
protected boolean isListenerAdditionOrRemoval(java.lang.reflect.Method method)
(add|remove).*Listener
.method
- method to testtrue
if method obeys the name pattern of listener
addition or removalprotected boolean isListener(java.lang.Class type)
type
- class to testtrue
if the class is an sub-interface of
java.util.EventListener
protected java.lang.Object spinOver(java.lang.Object object)
object
- object to spin-over