Dali Provisional API
Release 3.2

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

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

public abstract class ReflectiveChangeListener
extends Object

This factory builds listeners that reflectively forward change events. 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.


Field Summary
protected static Class<CollectionAddEvent> COLLECTION_ADD_EVENT_CLASS
           
protected static Class<CollectionAddEvent>[] COLLECTION_ADD_EVENT_CLASS_ARRAY
           
protected static Class<CollectionChangeEvent> COLLECTION_CHANGE_EVENT_CLASS
           
protected static Class<CollectionChangeEvent>[] COLLECTION_CHANGE_EVENT_CLASS_ARRAY
           
protected static Class<CollectionClearEvent> COLLECTION_CLEAR_EVENT_CLASS
           
protected static Class<CollectionClearEvent>[] COLLECTION_CLEAR_EVENT_CLASS_ARRAY
           
protected static Class<CollectionEvent> COLLECTION_EVENT_CLASS
           
protected static Class<CollectionEvent>[] COLLECTION_EVENT_CLASS_ARRAY
           
protected static Class<CollectionRemoveEvent> COLLECTION_REMOVE_EVENT_CLASS
           
protected static Class<CollectionRemoveEvent>[] COLLECTION_REMOVE_EVENT_CLASS_ARRAY
           
protected static Class<ListAddEvent> LIST_ADD_EVENT_CLASS
           
protected static Class<ListAddEvent>[] LIST_ADD_EVENT_CLASS_ARRAY
           
protected static Class<ListChangeEvent> LIST_CHANGE_EVENT_CLASS
           
protected static Class<ListChangeEvent>[] LIST_CHANGE_EVENT_CLASS_ARRAY
           
protected static Class<ListClearEvent> LIST_CLEAR_EVENT_CLASS
           
protected static Class<ListClearEvent>[] LIST_CLEAR_EVENT_CLASS_ARRAY
           
protected static Class<ListEvent> LIST_EVENT_CLASS
           
protected static Class<ListEvent>[] LIST_EVENT_CLASS_ARRAY
           
protected static Class<ListMoveEvent> LIST_MOVE_EVENT_CLASS
           
protected static Class<ListMoveEvent>[] LIST_MOVE_EVENT_CLASS_ARRAY
           
protected static Class<ListRemoveEvent> LIST_REMOVE_EVENT_CLASS
           
protected static Class<ListRemoveEvent>[] LIST_REMOVE_EVENT_CLASS_ARRAY
           
protected static Class<ListReplaceEvent> LIST_REPLACE_EVENT_CLASS
           
protected static Class<ListReplaceEvent>[] LIST_REPLACE_EVENT_CLASS_ARRAY
           
protected static Class<PropertyChangeEvent> PROPERTY_CHANGE_EVENT_CLASS
           
protected static Class<PropertyChangeEvent>[] PROPERTY_CHANGE_EVENT_CLASS_ARRAY
           
protected static Class<StateChangeEvent> STATE_CHANGE_EVENT_CLASS
           
protected static Class<StateChangeEvent>[] STATE_CHANGE_EVENT_CLASS_ARRAY
           
protected  Object target
          the target object on which we will invoke the method
 
Constructor Summary
protected ReflectiveChangeListener(Object target)
          Construct a listener that will invoke the specified method on the specified target.
 
Method Summary
static CollectionChangeListener buildCollectionChangeListener(Object target, Method method)
          Construct a collection change listener that will invoke the specified method on the specified target for any change event.
static CollectionChangeListener buildCollectionChangeListener(Object target, Method addMethod, Method removeMethod, Method clearMethod, Method changeMethod)
          Construct a collection change listener that will invoke the specified methods on the specified target.
static CollectionChangeListener buildCollectionChangeListener(Object target, String methodName)
          Construct a collection change listener that will invoke the specified method on the specified target for any change event.
static CollectionChangeListener buildCollectionChangeListener(Object target, String addMethodName, String removeMethodName, String clearMethodName, String changeMethodName)
          Construct a collection change listener that will invoke the specified methods on the specified target for change events.
static ListChangeListener buildListChangeListener(Object target, Method method)
          Construct a list change listener that will invoke the specified method on the specified target for any change event.
static ListChangeListener buildListChangeListener(Object target, Method addMethod, Method removeMethod, Method replaceMethod, Method moveMethod, Method clearMethod, Method changeMethod)
          Construct a list change listener that will invoke the specified methods on the specified target.
static ListChangeListener buildListChangeListener(Object target, String methodName)
          Construct a list change listener that will invoke the specified method on the specified target for any change event.
static ListChangeListener buildListChangeListener(Object target, String addMethodName, String removeMethodName, String replaceMethodName, String moveMethodName, String clearMethodName, String changeMethodName)
          Construct a list change listener that will invoke the specified methods on the specified target for change events.
static PropertyChangeListener buildPropertyChangeListener(Object target, Method method)
          Construct a property change listener that will invoke the specified method on the specified target.
static PropertyChangeListener buildPropertyChangeListener(Object target, String methodName)
          Construct a property change listener that will invoke the specified method on the specified target.
static StateChangeListener buildStateChangeListener(Object target, Method method)
          Construct a state change listener that will invoke the specified method on the specified target.
static StateChangeListener buildStateChangeListener(Object target, String methodName)
          Construct a state change listener that will invoke the specified method on the specified target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

protected final Object target
the target object on which we will invoke the method


STATE_CHANGE_EVENT_CLASS

protected static final Class<StateChangeEvent> STATE_CHANGE_EVENT_CLASS

STATE_CHANGE_EVENT_CLASS_ARRAY

protected static final Class<StateChangeEvent>[] STATE_CHANGE_EVENT_CLASS_ARRAY

PROPERTY_CHANGE_EVENT_CLASS

protected static final Class<PropertyChangeEvent> PROPERTY_CHANGE_EVENT_CLASS

PROPERTY_CHANGE_EVENT_CLASS_ARRAY

protected static final Class<PropertyChangeEvent>[] PROPERTY_CHANGE_EVENT_CLASS_ARRAY

COLLECTION_EVENT_CLASS

protected static final Class<CollectionEvent> COLLECTION_EVENT_CLASS

COLLECTION_EVENT_CLASS_ARRAY

protected static final Class<CollectionEvent>[] COLLECTION_EVENT_CLASS_ARRAY

COLLECTION_ADD_EVENT_CLASS

protected static final Class<CollectionAddEvent> COLLECTION_ADD_EVENT_CLASS

COLLECTION_ADD_EVENT_CLASS_ARRAY

protected static final Class<CollectionAddEvent>[] COLLECTION_ADD_EVENT_CLASS_ARRAY

COLLECTION_REMOVE_EVENT_CLASS

protected static final Class<CollectionRemoveEvent> COLLECTION_REMOVE_EVENT_CLASS

COLLECTION_REMOVE_EVENT_CLASS_ARRAY

protected static final Class<CollectionRemoveEvent>[] COLLECTION_REMOVE_EVENT_CLASS_ARRAY

COLLECTION_CLEAR_EVENT_CLASS

protected static final Class<CollectionClearEvent> COLLECTION_CLEAR_EVENT_CLASS

COLLECTION_CLEAR_EVENT_CLASS_ARRAY

protected static final Class<CollectionClearEvent>[] COLLECTION_CLEAR_EVENT_CLASS_ARRAY

COLLECTION_CHANGE_EVENT_CLASS

protected static final Class<CollectionChangeEvent> COLLECTION_CHANGE_EVENT_CLASS

COLLECTION_CHANGE_EVENT_CLASS_ARRAY

protected static final Class<CollectionChangeEvent>[] COLLECTION_CHANGE_EVENT_CLASS_ARRAY

LIST_EVENT_CLASS

protected static final Class<ListEvent> LIST_EVENT_CLASS

LIST_EVENT_CLASS_ARRAY

protected static final Class<ListEvent>[] LIST_EVENT_CLASS_ARRAY

LIST_ADD_EVENT_CLASS

protected static final Class<ListAddEvent> LIST_ADD_EVENT_CLASS

LIST_ADD_EVENT_CLASS_ARRAY

protected static final Class<ListAddEvent>[] LIST_ADD_EVENT_CLASS_ARRAY

LIST_REMOVE_EVENT_CLASS

protected static final Class<ListRemoveEvent> LIST_REMOVE_EVENT_CLASS

LIST_REMOVE_EVENT_CLASS_ARRAY

protected static final Class<ListRemoveEvent>[] LIST_REMOVE_EVENT_CLASS_ARRAY

LIST_REPLACE_EVENT_CLASS

protected static final Class<ListReplaceEvent> LIST_REPLACE_EVENT_CLASS

LIST_REPLACE_EVENT_CLASS_ARRAY

protected static final Class<ListReplaceEvent>[] LIST_REPLACE_EVENT_CLASS_ARRAY

LIST_MOVE_EVENT_CLASS

protected static final Class<ListMoveEvent> LIST_MOVE_EVENT_CLASS

LIST_MOVE_EVENT_CLASS_ARRAY

protected static final Class<ListMoveEvent>[] LIST_MOVE_EVENT_CLASS_ARRAY

LIST_CLEAR_EVENT_CLASS

protected static final Class<ListClearEvent> LIST_CLEAR_EVENT_CLASS

LIST_CLEAR_EVENT_CLASS_ARRAY

protected static final Class<ListClearEvent>[] LIST_CLEAR_EVENT_CLASS_ARRAY

LIST_CHANGE_EVENT_CLASS

protected static final Class<ListChangeEvent> LIST_CHANGE_EVENT_CLASS

LIST_CHANGE_EVENT_CLASS_ARRAY

protected static final Class<ListChangeEvent>[] LIST_CHANGE_EVENT_CLASS_ARRAY
Constructor Detail

ReflectiveChangeListener

protected ReflectiveChangeListener(Object target)
Construct a listener that will invoke the specified method on the specified target.

Method Detail

buildStateChangeListener

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


buildStateChangeListener

public static StateChangeListener buildStateChangeListener(Object target,
                                                           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(Object target,
                                                                 Method method)
Construct a property change listener that will invoke the specified method on the specified target.


buildPropertyChangeListener

public static PropertyChangeListener buildPropertyChangeListener(Object target,
                                                                 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(Object target,
                                                                     Method addMethod,
                                                                     Method removeMethod,
                                                                     Method clearMethod,
                                                                     Method changeMethod)
Construct a collection change listener that will invoke the specified methods on the specified target.


buildCollectionChangeListener

public static CollectionChangeListener buildCollectionChangeListener(Object target,
                                                                     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(Object target,
                                                                     String addMethodName,
                                                                     String removeMethodName,
                                                                     String clearMethodName,
                                                                     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(Object target,
                                                                     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(Object target,
                                                         Method addMethod,
                                                         Method removeMethod,
                                                         Method replaceMethod,
                                                         Method moveMethod,
                                                         Method clearMethod,
                                                         Method changeMethod)
Construct a list change listener that will invoke the specified methods on the specified target.


buildListChangeListener

public static ListChangeListener buildListChangeListener(Object target,
                                                         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(Object target,
                                                         String addMethodName,
                                                         String removeMethodName,
                                                         String replaceMethodName,
                                                         String moveMethodName,
                                                         String clearMethodName,
                                                         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(Object target,
                                                         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.


Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.