01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.catalog;
16:
17: import java.io.IOException;
18:
19: import org.eclipse.core.runtime.IProgressMonitor;
20:
21: /**
22: * An IResolverFactoryManager processes the net.refractions.udig.resolvers extension point and allows client
23: * code to resolve {@link IResolve} objects to other objects.
24: *
25: * <p>
26: * This class is similar in functionality to the IAdapterManager in eclipse.
27: * </p>
28: *
29: * @author Jesse
30: * @since 1.1.0
31: */
32: public interface IResolveManager {
33:
34: /**
35: * Resolves an {@link IResolve} to another object or throws a {@link IllegalArgumentException} if the resolve
36: * cannot be resolved to the targetType
37: *
38: * @param resolve the {@link IResolve} to resolve.
39: * @param targetType the desired type to resolve to
40: * @param monitor A monitor for providing feedback about the current progress.
41: * @return an object of targetType.
42: */
43: public <T> T resolve(IResolve resolve, Class<T> targetType,
44: IProgressMonitor monitor) throws IOException;
45:
46: /**
47: * Returns true if the resolve can be resolved to the targetClass.
48: *
49: * @param resolve resolve to resolve to another class
50: * @param targetClass desired type to resolve to
51: * @return true if the resolve can be resolved to the targetClass.
52: */
53: public boolean canResolve(IResolve resolve, Class targetClass);
54:
55: /**
56: * Registers a factory with the ResolveManager
57: *
58: * @param factory new factory to use for resolving IResolves
59: */
60: public void registerResolves(IResolveAdapterFactory factory);
61:
62: /**
63: * Unregisters a factory from the ResolveManager.
64: *
65: * @param factory factory to unregister.
66: */
67: public void unregisterResolves(IResolveAdapterFactory factory);
68:
69: /**
70: * Excludes a type from being resolved for a given factory. IE ResolveManager will not use the provided factory to
71: * resolve to the resolveType
72: *
73: * @param factory
74: * @param resolveType
75: */
76: public void unregisterResolves(IResolveAdapterFactory factory,
77: Class resolveType);
78:
79: }
|