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 / catalogue / CRSCatalogLocator.java @ 793

History | View | Annotate | Download (3.09 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 CoordinateReferenceSystem library,
32
 * providing access to all CoordinateReferenceSystem services through the
33
 * {@link CoordinateReferenceSystemManager} .
34
 * 
35
 * @author gvSIG team
36
 * @version $Id$
37
 */
38
public class CRSCatalogLocator extends BaseLocator {
39

    
40
    /**
41
     * CoordinateReferenceSystem manager name.
42
     */
43
    public static final String MANAGER_NAME =
44
        "CRSCatalog.manager";
45

    
46
    /**
47
     * CoordinateReferenceSystem manager description.
48
     */
49
    public static final String MANAGER_DESCRIPTION =
50
        "CRS Catalog Manager";
51

    
52
    private static final String LOCATOR_NAME =
53
        "CRSCatalog.locator";
54

    
55
    /**
56
     * Unique instance.
57
     */
58
    private static final CRSCatalogLocator INSTANCE =
59
        new CRSCatalogLocator();
60

    
61
    /**
62
     * Return the singleton instance.
63
     * 
64
     * @return the singleton instance
65
     */
66
    public static CRSCatalogLocator getInstance() {
67
        return INSTANCE;
68
    }
69

    
70
    /**
71
     * Return the Locator's name.
72
     * 
73
     * @return a String with the Locator's name
74
     */
75
    public final String getLocatorName() {
76
        return LOCATOR_NAME;
77
    }
78

    
79
    /**
80
     * Return a reference to the CoordinateReferenceSystemManager.
81
     * 
82
     * @return a reference to the CoordinateReferenceSystemManager
83
     * @throws LocatorException
84
     *             if there is no access to the class or the class cannot be
85
     *             instantiated
86
     * @see Locator#get(String)
87
     */
88
    public static CRSCatalogueManager getManager()
89
        throws LocatorException {
90
        return (CRSCatalogueManager) getInstance().get(
91
            MANAGER_NAME);
92
    }
93

    
94
    /**
95
     * Registers the Class implementing the CoordinateReferenceSystemManager
96
     * interface.
97
     * 
98
     * @param clazz
99
     *            implementing the CoordinateReferenceSystemManager interface
100
     */
101
    public static void registerManager(Class clazz) {
102
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
103
    }
104

    
105
}