01: package net.refractions.udig.mapgraphic.internal;
02:
03: import java.io.Serializable;
04: import java.net.URL;
05: import java.util.HashMap;
06: import java.util.Map;
07:
08: import net.refractions.udig.catalog.IService;
09: import net.refractions.udig.catalog.ServiceExtension;
10:
11: public class MapGraphicServiceExtension implements ServiceExtension {
12:
13: public static final String KEY = "graphic"; //$NON-NLS-1$
14:
15: /**
16: * TODO summary sentence for createService ...
17: *
18: * @see net.refractions.udig.catalog.ServiceExtension#createService(java.net.URL, java.util.Map)
19: * @param id
20: * @param params
21: * @return
22: */
23: public IService createService(URL id, Map params) {
24: if (params.containsKey(KEY)) {
25: return new MapGraphicService();
26: }
27: return null;
28: }
29:
30: /**
31: * TODO summary sentence for createParams ...
32: *
33: * @see net.refractions.udig.catalog.ServiceExtension#createParams(java.net.URL)
34: * @param url
35: * @return
36: */
37: public Map<String, Serializable> createParams(URL url) {
38: if (url != null
39: && url.toExternalForm().startsWith(
40: MapGraphicService.SERVICE_URL.toExternalForm())) {
41: Map<String, Serializable> map = new HashMap<String, Serializable>();
42: map.put(KEY, url);
43: return map;
44: }
45: return null;
46: }
47:
48: }
|