Package spin.off
Class ListenerSpinOver
java.lang.Object
spin.Evaluator
spin.off.ListenerSpinOver
An evaluator for spin-off that automatically spins-over all arguments of a
Use an instance of this class on construction of a Spin object or install it globally by calling the static method:
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());
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidevaluate(Invocation invocation) Evaluate the given invocation.protected booleanisListener(Class type) Test if the given class is a listener subinterface.protected booleanisListenerAdditionOrRemoval(Method method) Test if the given method is a listener addition or removal.protected ObjectSpin-over the given object.
-
Constructor Details
-
ListenerSpinOver
public ListenerSpinOver()Constructor. -
ListenerSpinOver
Constructor.- Parameters:
evaluator- the evaluator to wrap
-
-
Method Details
-
evaluate
Description copied from class:EvaluatorEvaluate the given invocation. -
isListenerAdditionOrRemoval
Test if the given method is a listener addition or removal. For this the methods name must obey the name pattern(add|remove).*Listener.- Parameters:
method- method to test- Returns:
trueif method obeys the name pattern of listener addition or removal
-
isListener
Test if the given class is a listener subinterface.- Parameters:
type- class to test- Returns:
trueif the class is an sub-interface ofjava.util.EventListener
-
spinOver
Spin-over the given object.- Parameters:
object- object to spin-over- Returns:
- Spin proxy
-