| java.lang.Object net.sf.jga.swing.FunctorProxy
FunctorProxy | public class FunctorProxy (Code) | | 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
|
Method Summary | |
public static Proxy | makeListenerFor(Object obj) Manufactures a Proxy that can listen to any/all events that the given
object may fire. | public static Proxy | newProxyInstance(ClassLoader loader, Class[] interfaces) Returns an instance of a proxy class for the specified interfaces that dispatches
method invocations to functors registed via a FunctorInvocationHandler. | public static void | register(Proxy proxy, String methodName, 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. | public static void | register(Proxy proxy, String methodName, UnaryFunctor functor) Registers the given functor to be invoked by the proxy when a method with the given
method is called. | public static void | register(Proxy proxy, Method method, UnaryFunctor functor) Registers the given functor to be invoked by the proxy when the given method is called. | public static void | register(Proxy proxy, Class listenerClass, Class eventClass, String methodName, UnaryFunctor functor) Registers a functor to be evaluated when the given method is invoked. |
makeListenerFor | public static Proxy makeListenerFor(Object obj)(Code) | | Manufactures a Proxy that can listen to any/all events that the given
object may fire. The generated Proxy's invocation handler will be an
instance FunctorInvocationHandler.
|
newProxyInstance | public static Proxy newProxyInstance(ClassLoader loader, Class[] interfaces)(Code) | | Returns an instance of a proxy class for the specified interfaces that dispatches
method invocations to functors registed via a FunctorInvocationHandler.
|
register | public static void register(Proxy proxy, String methodName, String expression) throws ParseException, NoSuchMethodException(Code) | | Registers the functor described by the given expression, to be invoked by the proxy
when a method with the given method is called. If the proxy supports more than one
method with this name, then which one will be invoked is undefined.
throws: NoSuchMethodException - if no method with the given name is found throws: ParseException - if the expression cannot be parsed throws: ClassCastException - if the given proxy's handler is not a FunctorInvocationHandler |
register | public static void register(Proxy proxy, String methodName, UnaryFunctor functor) throws NoSuchMethodException(Code) | | Registers the given functor to be invoked by the proxy when a method with the given
method is called. If the proxy supports more than one method with this name, then
which one will be invoked is undefined.
throws: NoSuchMethodException - if no method with the given name is found throws: ClassCastException - if the given proxy's handler is not a FunctorInvocationHandler |
register | public static void register(Proxy proxy, Method method, UnaryFunctor functor)(Code) | | Registers the given functor to be invoked by the proxy when the given method is called.
throws: ClassCastException - if the given proxy's handler is not a FunctorInvocationHandler |
|
|