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.project;
16:
17: /**
18: * Modifies an IGeoResource based before returned to caller of
19: * {@link ILayer#getResource(Class, org.eclipse.core.runtime.IProgressMonitor)}.
20: *
21: * @param <T> the type of resources that this interceptor can work on.
22: * @author Jesse
23: * @since 1.1.0
24: */
25: public interface IResourceInterceptor<T> {
26: /**
27: * Modifies the resource that is returned. The returned value is not necessarily the value passed in as a parameter
28: *
29: * @param layer the layer that the resources is being obtained from.
30: * @param resource The resource obtained from the IGeoResource.
31: * @param requestedType the type that the caller requested.
32: * @return the resource to return to the caller. May be a new instance or the same instance.
33: */
34: T run(ILayer layer, T resource, Class<? super T> requestedType);
35: }
|