|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.swing.FunctorProxy
public class FunctorProxy
Factory that builds Proxy objects that map Functors to event notification methods. Using this proxy is a two step process: first build the proxy instance calling makeListenerFor or newProxyInstance; second, register the desired functors with the various registration methods.
Copyright © 2005 David A. Hall
Nested Class Summary | |
---|---|
static class |
FunctorProxy.FunctorInvocationHandler
The InvocationHandler for FunctorProxy instances. |
Constructor Summary | |
---|---|
FunctorProxy()
|
Method Summary | |
---|---|
static java.lang.reflect.Proxy |
makeListenerFor(java.lang.Object obj)
Manufactures a Proxy that can listen to any/all events that the given object may fire. |
static java.lang.reflect.Proxy |
newProxyInstance(java.lang.ClassLoader loader,
java.lang.Class<?>[] interfaces)
Returns an instance of a proxy class for the specified interfaces that dispatches method invocations to functors registed via a FunctorInvocationHandler. |
static void |
register(java.lang.reflect.Proxy proxy,
java.lang.Class<?> listenerClass,
java.lang.Class<?> eventClass,
java.lang.String methodName,
UnaryFunctor<?,?> functor)
Registers a functor to be evaluated when the given method is invoked. |
static void |
register(java.lang.reflect.Proxy proxy,
java.lang.reflect.Method method,
UnaryFunctor<?,?> functor)
Registers the given functor to be invoked by the proxy when the given method is called. |
static void |
register(java.lang.reflect.Proxy proxy,
java.lang.String methodName,
java.lang.String expression)
Registers the functor described by the given expression, to be invoked by the proxy when a method with the given method is called. |
static void |
register(java.lang.reflect.Proxy proxy,
java.lang.String methodName,
UnaryFunctor<?,?> functor)
Registers the given functor to be invoked by the proxy when a method with the given method is called. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FunctorProxy()
Method Detail |
---|
public static java.lang.reflect.Proxy makeListenerFor(java.lang.Object obj)
public static java.lang.reflect.Proxy newProxyInstance(java.lang.ClassLoader loader, java.lang.Class<?>[] interfaces)
public static void register(java.lang.reflect.Proxy proxy, java.lang.String methodName, java.lang.String expression) throws ParseException, java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
- if no method with the given name is found
ParseException
- if the expression cannot be parsed
java.lang.ClassCastException
- if the given proxy's handler is not a FunctorInvocationHandlerpublic static void register(java.lang.reflect.Proxy proxy, java.lang.String methodName, UnaryFunctor<?,?> functor) throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
- if no method with the given name is found
java.lang.ClassCastException
- if the given proxy's handler is not a FunctorInvocationHandlerpublic static void register(java.lang.reflect.Proxy proxy, java.lang.reflect.Method method, UnaryFunctor<?,?> functor)
java.lang.ClassCastException
- if the given proxy's handler is not a FunctorInvocationHandlerpublic static void register(java.lang.reflect.Proxy proxy, java.lang.Class<?> listenerClass, java.lang.Class<?> eventClass, java.lang.String methodName, UnaryFunctor<?,?> functor) throws java.lang.NoSuchMethodException, java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the proxy does not implement the listenerClass
java.lang.NoSuchMethodException
- if the proxy does not have a method with the given
name that takes an argument of class eventClass
java.lang.ClassCastException
- if the given proxy's handler is not a FunctorInvocationHandler
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |