root / org.gvsig.proj / branches / refactor2018 / org.gvsig.proj / org.gvsig.proj.catalog / org.gvsig.proj.catalog.api / src / main / java / org / gvsig / proj / catalogue / CRSCatalogLocator.java @ 794
History | View | Annotate | Download (3.08 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2012 gvSIG Association.
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.proj.catalogue; |
25 |
|
26 |
import org.gvsig.tools.locator.BaseLocator; |
27 |
import org.gvsig.tools.locator.Locator; |
28 |
import org.gvsig.tools.locator.LocatorException; |
29 |
|
30 |
/**
|
31 |
* This locator is the entry point for the CRSCatalogue library,
|
32 |
* providing a catalog of definitions for coordinate reference systems
|
33 |
* and coordinate transformations through the
|
34 |
* {@link CRSCatalogueManager} .
|
35 |
*
|
36 |
* @author gvSIG team
|
37 |
* @author Cesar Martinez Izquierdo
|
38 |
*/
|
39 |
public class CRSCatalogLocator extends BaseLocator { |
40 |
|
41 |
/**
|
42 |
* CoordinateReferenceSystem manager name.
|
43 |
*/
|
44 |
public static final String MANAGER_NAME = |
45 |
"CRSCatalog.manager";
|
46 |
|
47 |
/**
|
48 |
* CoordinateReferenceSystem manager description.
|
49 |
*/
|
50 |
public static final String MANAGER_DESCRIPTION = |
51 |
"CRS Catalog Manager";
|
52 |
|
53 |
private static final String LOCATOR_NAME = |
54 |
"CRSCatalog.locator";
|
55 |
|
56 |
/**
|
57 |
* Unique instance.
|
58 |
*/
|
59 |
private static final CRSCatalogLocator INSTANCE = |
60 |
new CRSCatalogLocator();
|
61 |
|
62 |
/**
|
63 |
* Return the singleton instance.
|
64 |
*
|
65 |
* @return the singleton instance
|
66 |
*/
|
67 |
public static CRSCatalogLocator getInstance() { |
68 |
return INSTANCE;
|
69 |
} |
70 |
|
71 |
/**
|
72 |
* Return the Locator's name.
|
73 |
*
|
74 |
* @return a String with the Locator's name
|
75 |
*/
|
76 |
public final String getLocatorName() { |
77 |
return LOCATOR_NAME;
|
78 |
} |
79 |
|
80 |
/**
|
81 |
* Return a reference to the CRSCatalogueManager.
|
82 |
*
|
83 |
* @return a reference to the CRSCatalogueManager
|
84 |
* @throws LocatorException
|
85 |
* if there is no access to the class or the class cannot be
|
86 |
* instantiated
|
87 |
* @see Locator#get(String)
|
88 |
*/
|
89 |
public static CRSCatalogManager getManager() |
90 |
throws LocatorException {
|
91 |
return (CRSCatalogManager) getInstance().get(
|
92 |
MANAGER_NAME); |
93 |
} |
94 |
|
95 |
/**
|
96 |
* Registers the Class implementing the CRSCatalogueManager
|
97 |
* interface.
|
98 |
*
|
99 |
* @param clazz
|
100 |
* implementing the CoordinateReferenceSystemManager interface
|
101 |
*/
|
102 |
public static void registerManager(Class clazz) { |
103 |
getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz); |
104 |
} |
105 |
|
106 |
} |