|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspin.Evaluator
spin.off.ListenerSpinOver
An evaluator for spin-off that automatically spins-over all
arguments of a SpinOffEvaluator
if their corresponding parameter
types are subinterfaces of java.util.EventListener
.
Use an instance of this class on construction of a Spin object
or install it globally by calling the static method:
Spin.setDefaultOffEvaluator(new ListenerSpinOver());
isListenerAdditionOrRemoval(java.lang.reflect.Method)
,
isListener(java.lang.Class)
Constructor Summary | |
ListenerSpinOver()
|
|
ListenerSpinOver(Evaluator evaluator)
|
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ListenerSpinOver()
public ListenerSpinOver(Evaluator evaluator)
Method Detail |
public void evaluate(Invocation invocation) throws java.lang.Throwable
Evaluator
evaluate
in class Evaluator
invocation
- invocation to evaluate
java.lang.Throwable
protected boolean isListenerAdditionOrRemoval(java.lang.reflect.Method method)
(add|remove).*Listener
.
method
- method to test
true
if method obeys the name pattern of
listener addition or removalprotected boolean isListener(java.lang.Class type)
type
- class to test
true
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |