Statistics
| Revision:

gvsig-osm / org.gvsig.raster.osm / trunk / org.gvsig.raster.osm / org.gvsig.raster.osm.io / src / main / java / org / gvsig / raster / osm / io / OSMException.java @ 85

History | View | Annotate | Download (2.26 KB)

1
/* OSM layers for gvSIG. 
2
 * Geographic Information System of the Valencian Government
3
*
4
* Copyright (C) 2012 Nacho Brodin
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
package org.gvsig.raster.osm.io;
23

    
24
import java.util.Hashtable;
25
import java.util.Map;
26

    
27
/**
28
 * @author Nacho Brodin (nachobrodin@gmail.com)
29
 */
30
public class OSMException extends Exception {
31
    private static final long serialVersionUID = 1476084093500156070L;
32
    private String            wmtsCode         = null;
33
    protected String          formatString     = null;
34
    protected String          messageKey       = null;
35
    protected long            code             = 0;
36

    
37
    public OSMException() {                
38
        init();                        
39
    }        
40

    
41
    public OSMException(Throwable cause) {        
42
            super(cause);
43
        init();        
44
        initCause(cause);
45
    }
46
    
47
    public OSMException(String msg, Throwable cause) {        
48
            super(msg, cause);
49
        init();        
50
        this.formatString = msg;
51
    }
52

    
53
    public OSMException(String wfsCode,String message) {                
54
        init();        
55
        formatString = message;
56
        this.wmtsCode = wfsCode;
57
    }        
58

    
59
    public OSMException(String message) {        
60
        init(); 
61
        formatString = message;       
62
    }   
63

    
64
        @SuppressWarnings("unchecked")
65
        protected Map values() {                
66
        Hashtable params;
67
        params = new Hashtable();                
68
        return params;
69
    }
70

    
71
    public void init() {
72
        messageKey = "wmts_exception";
73
        formatString = "WMTS Exception";
74
        code = serialVersionUID;
75
    }
76

    
77
    /**
78
     * @return Returns the wfsCode.
79
     */
80
    public String getWfsCode() {
81
        return wmtsCode;
82
    }        
83
}