svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libMetadata / src / org / gvsig / metadata / MDLocator.java @ 25404
History | View | Annotate | Download (2.63 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program 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
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2008 Geographic Information research group: http://www.geoinfo.uji.es
|
26 |
* Departamento de Lenguajes y Sistemas Inform?ticos (LSI)
|
27 |
* Universitat Jaume I
|
28 |
* {{Task}}
|
29 |
*/
|
30 |
|
31 |
package org.gvsig.metadata; |
32 |
|
33 |
import org.gvsig.tools.locator.AbstractLocator; |
34 |
import org.gvsig.tools.locator.LocatorException; |
35 |
|
36 |
|
37 |
public class MDLocator extends AbstractLocator { |
38 |
|
39 |
public static final String METADATA_MANAGER_NAME = "MDManager"; |
40 |
|
41 |
private static final String LOCATOR_NAME = "MDLocator"; |
42 |
|
43 |
private static final String METADATA_MANAGER_DESCRIPTION = "Compatible implementation for MDManager"; |
44 |
|
45 |
|
46 |
|
47 |
/**
|
48 |
* Unique instance.
|
49 |
*/
|
50 |
private static final MDLocator instance = new MDLocator(); |
51 |
|
52 |
/**
|
53 |
* Return the singleton instance.
|
54 |
*
|
55 |
* @return the singleton instance
|
56 |
*/
|
57 |
public static MDLocator getInstance() { |
58 |
return instance;
|
59 |
} |
60 |
|
61 |
/**
|
62 |
* Return a reference to MDManager.
|
63 |
*
|
64 |
* @return a reference to MDManager
|
65 |
* @throws LocatorException
|
66 |
* if there is no access to the class or the class cannot be
|
67 |
* instantiated
|
68 |
* @see Locator#get(String)
|
69 |
*/
|
70 |
public static MDManager getMDManager() throws LocatorException { |
71 |
return (MDManager) getInstance().get(METADATA_MANAGER_NAME);
|
72 |
} |
73 |
|
74 |
/**
|
75 |
* Registers the Class implementing the MDManager interface.
|
76 |
*
|
77 |
* @param clazz
|
78 |
* implementing the MDManager interface
|
79 |
*/
|
80 |
public static void registerMDManager(Class clazz) { |
81 |
getInstance().register(METADATA_MANAGER_NAME, METADATA_MANAGER_DESCRIPTION, clazz); |
82 |
} |
83 |
|
84 |
public String getLocatorName() { |
85 |
return LOCATOR_NAME;
|
86 |
} |
87 |
|
88 |
} |