01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.catalog;
17:
18: import java.io.IOException;
19: import org.geotools.util.ProgressListener;
20:
21: /**
22: * Adapts a resolve handle into another type of object.
23: *
24: * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
25: *
26: */
27: public interface ResolveAdapterFactory {
28: /**
29: * Determines if a perticular adaptation is supported.
30: *
31: * @param resolve The handle being adapted.
32: * @param adapter The adapting class.
33: *
34: * @return True if supported, otherwise false.
35: */
36: boolean canAdapt(Resolve resolve, Class adapter);
37:
38: /**
39: * Performs an adaptation to a particular adapter.
40: *
41: * @param resolve The handle being adapted.
42: * @param adapter The adapting class.
43: * @param monitor Progress monitor for blocking class.
44: *
45: * @return The adapter, or null if adapation not possible.
46: *
47: * @throws IOException Any I/O errors that occur.
48: */
49: Object adapt(Resolve resolve, Class adapter,
50: ProgressListener monitor) throws IOException;
51: }
|