1 /*
2 * $Id: IAdapterFactory.java,v 1.2 2007/05/24 12:26:17 oeuillot Exp $
3 */
4 package org.rcfaces.core.lang;
5
6 /**
7 * <p>
8 * An adapter factory defines behavioral extensions for one or more classes that
9 * implements the IAdaptable interface. Adapter factories are registered with an
10 * adapter manager.
11 * </p>
12 *
13 * Clients may implement this interface.
14 *
15 * @author Eclipse Team (latest modification by $Author: oeuillot $)
16 * @version $Revision: 1.2 $ $Date: 2007/05/24 12:26:17 $
17 */
18 public interface IAdapterFactory {
19 /**
20 * Returns an object which is an instance of the given class associated with
21 * the given object. Returns <code>null</code> if no such object can be
22 * found.
23 *
24 * @param adaptableObject
25 * the adaptable object being queried (usually an instance of
26 * <code>IAdaptable</code>)
27 * @param adapterType
28 * the type of adapter to look up
29 * @return a object castable to the given adapter type, or <code>null</code>
30 * if this adapter factory does not have an adapter of the given
31 * type for the given object
32 */
33
34 Object getAdapter(Object adaptableObject, Class adapterType,
35 Object parameter);
36
37 /**
38 * Returns the collection of adapter types handled by this factory.
39 *
40 * This method is generally used by an adapter manager to discover which
41 * adapter types are supported, in advance of dispatching any actual
42 * getAdapter requests.
43 *
44 * @return the collection of adapter types
45 */
46 Class[] getAdapterList();
47 }