1
2
3
4
5
6
7
8
9
10
11
12
13
14 package net.sf.jgabl2.adapt;
15
16 import net.sf.jgabl2.adapt.impl.GenericAdapterManagerImpl;
17
18 /**
19 * An manager for adapters of objects.
20 * Resembles the adapter mechanism of Eclipse.
21 *
22 * @author Alexander Schwartz
23 * @since 0.5.0
24 */
25 public interface IGenericAdapterManager {
26
27 /** The default implementation. */
28 public static final IGenericAdapterManager DEFAULT_INSTANCE
29 = new GenericAdapterManagerImpl();
30
31 /**
32 * Retrieves an adapter of the specified type <code>t</code>.
33 *
34 * @todo Can we get rid of the type parameter?
35 *
36 * @param object the object to be adapted
37 * @param type the type of the requested adapter
38 * @param <AdapterType> the type of the requested adapter
39 *
40 * @return an adapter of the requested type; may not be <code>null</code>
41 * @throws UnavailableAdapterException if and only if no such adapter is
42 * available
43 */
44 <AdapterType> AdapterType getAdapter(Object object, Class<?> type)
45 throws UnavailableAdapterException;
46 }