Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.api / src / main / java / org / gvsig / fmap / geom / type / GeometryTypeNotValidException.java @ 40767

History | View | Annotate | Download (2.69 KB)

1 40559 jjdelcerro
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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 40435 jjdelcerro
25
package org.gvsig.fmap.geom.type;
26
27
import java.util.HashMap;
28
import java.util.Map;
29
30
import org.gvsig.fmap.geom.GeometryException;
31
32
/**
33
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
34
 */
35
public class GeometryTypeNotValidException extends GeometryException {
36
        private static final long serialVersionUID = 2588983103873322295L;
37
38
        /**
39
         * Key to retrieve this exception's message
40
         */
41
        private static final String MESSAGE_KEY = "geometry_type_not_valid_exception";
42
        /**
43
         * This exception's message. Substitution fields follow the format %(fieldName) and
44
         * must be stored in the Map returned by the values() method.
45
         */
46
        private static final String FORMAT_STRING =
47
                "The geometry with type %(type) and subType %(subType) is not supported.";
48
49
        /**
50
         * Class name of the geometry type. Should never be null in this exception
51
         */
52
        private int type;
53
        private int subType;
54
55
        /**
56
         * Main constructor that provides both context data and a cause Exception
57
         * @param geomClass geometry class
58
         * @param e cause exception
59
         */
60
        public GeometryTypeNotValidException(int type, int subType, Exception e) {
61
                super(FORMAT_STRING, e, MESSAGE_KEY, serialVersionUID);
62
                // messageKey = MESSAGE_KEY;
63
                // formatString = FORMAT_STRING;
64
                // code = serialVersionUID;
65
                //
66
                // if (e != null) {
67
                // initCause(e);
68
                // }
69
70
                this.type = type;
71
                this.subType = subType;
72
        }
73
74
        /**
75
         * Main constructor that provides both context data and a cause Exception
76
         * @param geomClass geometry class
77
         * @param e cause exception
78
         */
79
        public GeometryTypeNotValidException(int type, int subType) {
80
                this(type, subType, null);
81
        }
82
83
        protected Map values() {
84
                HashMap map = new HashMap();
85
                map.put("type", new Integer(type));
86
                map.put("subType", new Integer(subType));
87
                return map;
88
        }
89
}
90