org.eclipse.jpt.utility.model.listener
Class ReflectiveChangeListener

java.lang.Object
  extended by org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener

public abstract class ReflectiveChangeListener
extends java.lang.Object

This factory builds listeners that reflectively forward ChangeEvents. If you are worried about having too many little classes that have to be loaded and maintained by the class loader, you can use one of these. Of course, this comes with the additional overhead of reflection.... Also note that the validity of the method name is not checked at compile time, but at runtime; although we *do* check the method as soon as the listener is instantiated. Provisional API: This class is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Method Summary
static CollectionChangeListener buildCollectionChangeListener(java.lang.Object target, java.lang.reflect.Method method)
          Construct a collection change listener that will invoke the specified method on the specified target for any change event.
static CollectionChangeListener buildCollectionChangeListener(java.lang.Object target, java.lang.reflect.Method addMethod, java.lang.reflect.Method removeMethod, java.lang.reflect.Method clearMethod, java.lang.reflect.Method changeMethod)
          Construct a collection change listener that will invoke the specified methods on the specified target.
static CollectionChangeListener buildCollectionChangeListener(java.lang.Object target, java.lang.String methodName)
          Construct a collection change listener that will invoke the specified method on the specified target for any change event.
static CollectionChangeListener buildCollectionChangeListener(java.lang.Object target, java.lang.String addMethodName, java.lang.String removeMethodName, java.lang.String clearMethodName, java.lang.String changeMethodName)
          Construct a collection change listener that will invoke the specified methods on the specified target for change events.
static ListChangeListener buildListChangeListener(java.lang.Object target, java.lang.reflect.Method method)
          Construct a list change listener that will invoke the specified method on the specified target for any change event.
static ListChangeListener buildListChangeListener(java.lang.Object target, java.lang.reflect.Method addMethod, java.lang.reflect.Method removeMethod, java.lang.reflect.Method replaceMethod, java.lang.reflect.Method moveMethod, java.lang.reflect.Method clearMethod, java.lang.reflect.Method changeMethod)
          Construct a list change listener that will invoke the specified methods on the specified target.
static ListChangeListener buildListChangeListener(java.lang.Object target, java.lang.String methodName)
          Construct a list change listener that will invoke the specified method on the specified target for any change event.
static ListChangeListener buildListChangeListener(java.lang.Object target, java.lang.String addMethodName, java.lang.String removeMethodName, java.lang.String replaceMethodName, java.lang.String moveMethodName, java.lang.String clearMethodName, java.lang.String changeMethodName)
          Construct a list change listener that will invoke the specified methods on the specified target for change events.
static PropertyChangeListener buildPropertyChangeListener(java.lang.Object target, java.lang.reflect.Method method)
          Construct a property change listener that will invoke the specified method on the specified target.
static PropertyChangeListener buildPropertyChangeListener(java.lang.Object target, java.lang.String methodName)
          Construct a property change listener that will invoke the specified method on the specified target.
static StateChangeListener buildStateChangeListener(java.lang.Object target, java.lang.reflect.Method method)
          Construct a state change listener that will invoke the specified method on the specified target.
static StateChangeListener buildStateChangeListener(java.lang.Object target, java.lang.String methodName)
          Construct a state change listener that will invoke the specified method on the specified target.
static TreeChangeListener buildTreeChangeListener(java.lang.Object target, java.lang.reflect.Method method)
          Construct a tree change listener that will invoke the specified method on the specified target for any change event.
static TreeChangeListener buildTreeChangeListener(java.lang.Object target, java.lang.reflect.Method addMethod, java.lang.reflect.Method removeMethod, java.lang.reflect.Method clearMethod, java.lang.reflect.Method changeMethod)
          Construct a tree change listener that will invoke the specified methods on the specified target.
static TreeChangeListener buildTreeChangeListener(java.lang.Object target, java.lang.String methodName)
          Construct a tree change listener that will invoke the specified method on the specified target for any change event.
static TreeChangeListener buildTreeChangeListener(java.lang.Object target, java.lang.String addMethodName, java.lang.String removeMethodName, java.lang.String clearMethodName, java.lang.String changeMethodName)
          Construct a tree change listener that will invoke the specified methods on the specified target for change events.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildStateChangeListener

public static StateChangeListener buildStateChangeListener(java.lang.Object target,
                                                           java.lang.reflect.Method method)
Construct a state change listener that will invoke the specified method on the specified target.


buildStateChangeListener

public static StateChangeListener buildStateChangeListener(java.lang.Object target,
                                                           java.lang.String methodName)
Construct a state change listener that will invoke the specified method on the specified target. If a single-argument method with the specified name and appropriate argument is found, it will be invoked; otherwise, a zero-argument method with the specified name will be invoked.


buildPropertyChangeListener

public static PropertyChangeListener buildPropertyChangeListener(java.lang.Object target,
                                                                 java.lang.reflect.Method method)
Construct a property change listener that will invoke the specified method on the specified target.


buildPropertyChangeListener

public static PropertyChangeListener buildPropertyChangeListener(java.lang.Object target,
                                                                 java.lang.String methodName)
Construct a property change listener that will invoke the specified method on the specified target. If a single-argument method with the specified name and appropriate argument is found, it will be invoked; otherwise, a zero-argument method with the specified name will be invoked.


buildCollectionChangeListener

public static CollectionChangeListener buildCollectionChangeListener(java.lang.Object target,
                                                                     java.lang.reflect.Method addMethod,
                                                                     java.lang.reflect.Method removeMethod,
                                                                     java.lang.reflect.Method clearMethod,
                                                                     java.lang.reflect.Method changeMethod)
Construct a collection change listener that will invoke the specified methods on the specified target.


buildCollectionChangeListener

public static CollectionChangeListener buildCollectionChangeListener(java.lang.Object target,
                                                                     java.lang.reflect.Method method)
Construct a collection change listener that will invoke the specified method on the specified target for any change event.


buildCollectionChangeListener

public static CollectionChangeListener buildCollectionChangeListener(java.lang.Object target,
                                                                     java.lang.String addMethodName,
                                                                     java.lang.String removeMethodName,
                                                                     java.lang.String clearMethodName,
                                                                     java.lang.String changeMethodName)
Construct a collection change listener that will invoke the specified methods on the specified target for change events. If a single-argument method with the specified name and appropriate argument is found, it will be invoked; otherwise, a zero-argument method with the specified name will be invoked.


buildCollectionChangeListener

public static CollectionChangeListener buildCollectionChangeListener(java.lang.Object target,
                                                                     java.lang.String methodName)
Construct a collection change listener that will invoke the specified method on the specified target for any change event. If a single-argument method with the specified name and appropriate argument is found, it will be invoked; otherwise, a zero-argument method with the specified name will be invoked.


buildListChangeListener

public static ListChangeListener buildListChangeListener(java.lang.Object target,
                                                         java.lang.reflect.Method addMethod,
                                                         java.lang.reflect.Method removeMethod,
                                                         java.lang.reflect.Method replaceMethod,
                                                         java.lang.reflect.Method moveMethod,
                                                         java.lang.reflect.Method clearMethod,
                                                         java.lang.reflect.Method changeMethod)
Construct a list change listener that will invoke the specified methods on the specified target.


buildListChangeListener

public static ListChangeListener buildListChangeListener(java.lang.Object target,
                                                         java.lang.reflect.Method method)
Construct a list change listener that will invoke the specified method on the specified target for any change event.


buildListChangeListener

public static ListChangeListener buildListChangeListener(java.lang.Object target,
                                                         java.lang.String addMethodName,
                                                         java.lang.String removeMethodName,
                                                         java.lang.String replaceMethodName,
                                                         java.lang.String moveMethodName,
                                                         java.lang.String clearMethodName,
                                                         java.lang.String changeMethodName)
Construct a list change listener that will invoke the specified methods on the specified target for change events. If a single-argument method with the specified name and appropriate argument is found, it will be invoked; otherwise, a zero-argument method with the specified name will be invoked.


buildListChangeListener

public static ListChangeListener buildListChangeListener(java.lang.Object target,
                                                         java.lang.String methodName)
Construct a list change listener that will invoke the specified method on the specified target for any change event. If a single-argument method with the specified name and appropriate argument is found, it will be invoked; otherwise, a zero-argument method with the specified name will be invoked.


buildTreeChangeListener

public static TreeChangeListener buildTreeChangeListener(java.lang.Object target,
                                                         java.lang.reflect.Method addMethod,
                                                         java.lang.reflect.Method removeMethod,
                                                         java.lang.reflect.Method clearMethod,
                                                         java.lang.reflect.Method changeMethod)
Construct a tree change listener that will invoke the specified methods on the specified target.


buildTreeChangeListener

public static TreeChangeListener buildTreeChangeListener(java.lang.Object target,
                                                         java.lang.reflect.Method method)
Construct a tree change listener that will invoke the specified method on the specified target for any change event.


buildTreeChangeListener

public static TreeChangeListener buildTreeChangeListener(java.lang.Object target,
                                                         java.lang.String addMethodName,
                                                         java.lang.String removeMethodName,
                                                         java.lang.String clearMethodName,
                                                         java.lang.String changeMethodName)
Construct a tree change listener that will invoke the specified methods on the specified target for change events. If a single-argument method with the specified name and appropriate argument is found, it will be invoked; otherwise, a zero-argument method with the specified name will be invoked.


buildTreeChangeListener

public static TreeChangeListener buildTreeChangeListener(java.lang.Object target,
                                                         java.lang.String methodName)
Construct a tree change listener that will invoke the specified method on the specified target for any change event. If a single-argument method with the specified name and appropriate argument is found, it will be invoked; otherwise, a zero-argument method with the specified name will be invoked.