Statistics
| Revision:

root / org.gvsig.proj / branches / refactor2018 / org.gvsig.proj / org.gvsig.proj.catalog / org.gvsig.proj.catalog.api / src / main / java / org / gvsig / proj / catalog / CRSCatalogLocator.java @ 817

History | View | Annotate | Download (3.08 KB)

1 793 cmartinez
/**
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 807 cmartinez
package org.gvsig.proj.catalog;
25 793 cmartinez
26
import org.gvsig.tools.locator.BaseLocator;
27
import org.gvsig.tools.locator.Locator;
28
import org.gvsig.tools.locator.LocatorException;
29
30
/**
31 794 cmartinez
 * 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 793 cmartinez
 *
36
 * @author gvSIG team
37 794 cmartinez
 * @author Cesar Martinez Izquierdo
38 793 cmartinez
 */
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 794 cmartinez
     * Return a reference to the CRSCatalogueManager.
82 793 cmartinez
     *
83 794 cmartinez
     * @return a reference to the CRSCatalogueManager
84 793 cmartinez
     * @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 794 cmartinez
    public static CRSCatalogManager getManager()
90 793 cmartinez
        throws LocatorException {
91 794 cmartinez
        return (CRSCatalogManager) getInstance().get(
92 793 cmartinez
            MANAGER_NAME);
93
    }
94
95
    /**
96 794 cmartinez
     * Registers the Class implementing the CRSCatalogueManager
97 793 cmartinez
     * 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
}