01: /*
02: * uDig - User Friendly Desktop Internet GIS client
03: * http://udig.refractions.net
04: * (C) 2006, Refractions Research Inc.
05: * (C) 2006, GeoTools Project Management Committee (PMC).
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation;
10: * version 2.1 of the License.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: */
17: package net.refractions.udig.catalog;
18:
19: import java.io.IOException;
20:
21: import org.eclipse.core.runtime.IProgressMonitor;
22:
23: /**
24: * Adapts a resolve handle into another type of object.
25: * <p>
26: * This API differs from the generic eclipse adaptable api:
27: * <ul>
28: * <li>we need to explicitly account for contacting external resources
29: * </ul>
30: *
31: * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
32: *
33: */
34: public interface IResolveAdapterFactory {
35: /**
36: * Determines if a perticular adaptation is supported.
37: *
38: * @param resolve The handle being adapted.
39: * @param adapter The adapting class.
40: *
41: * @return True if supported, otherwise false.
42: */
43: boolean canAdapt(IResolve resolve, Class adapter);
44:
45: /**
46: * Performs an adaptation to a particular adapter.
47: *
48: * @param resolve The handle being adapted.
49: * @param adapter The adapting class.
50: * @param monitor Progress monitor for blocking class.
51: *
52: * @return The adapter, or null if adapation not possible.
53: *
54: * @throws IOException Any I/O errors that occur.
55: */
56: Object adapt(IResolve resolve, Class adapter,
57: IProgressMonitor monitor) throws IOException;
58: }
|