Statistics
| Revision:

gvsig-3d / 2.1 / trunk / org.gvsig.view3d / org.gvsig.view3d.lib / org.gvsig.view3d.lib.api / src / main / java / org / gvsig / view3d / lib / api / exception / FactoryNotRegisteredException.java @ 755

History | View | Annotate | Download (2.59 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2015 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.view3d.lib.api.exception;
25

    
26
import java.util.HashMap;
27
import java.util.Map;
28

    
29
import org.gvsig.tools.exception.BaseException;
30
import org.gvsig.view3d.lib.api.loader.LoaderFactory;
31

    
32
/**
33
 * This exception is used when a {@link LoaderFactory} is reclaimed and it is
34
 * not registered.
35
 * 
36
 * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
37
 *
38
 */
39
public class FactoryNotRegisteredException extends BaseException {
40

    
41
    private static final long serialVersionUID = -50040847467587585L;
42

    
43
    private static final String KEY = "XxfactoryNamexX_factory_is_not_registered";
44

    
45
    private static final String MESSAGE = "The factory %(factoryName) is not registered";
46

    
47
    private String factoryName;
48

    
49
    /**
50
     * Construct a FactoryNotRegisteredException with the specified factory
51
     * name and default exception message.
52
     * 
53
     * @param factoryName
54
     *            the factory name
55
     */
56
    public FactoryNotRegisteredException(String factoryName) {
57
        super(MESSAGE, KEY, serialVersionUID);
58
        this.factoryName = factoryName;
59
    }
60

    
61
    /**
62
     * Construct a FactoryNotRegisteredException with the specified factory
63
     * name and message.
64
     * 
65
     * @param factoryName
66
     *            the factory name
67
     * @param message
68
     *            the exception message
69
     */
70
    public FactoryNotRegisteredException(String factoryName, String message) {
71
        super(message, KEY, serialVersionUID);
72
        this.factoryName = factoryName;
73
    }
74

    
75
    @Override
76
    protected Map values() {
77
        Map<Object, Object> values = new HashMap<Object, Object>();
78
        values.put("factoryName", this.factoryName);
79
        return values;
80
    }
81
}