svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / operation / GeometryOperationNotSupportedException.java @ 21143
History | View | Annotate | Download (1.04 KB)
1 |
package org.gvsig.fmap.geom.operation; |
---|---|
2 |
|
3 |
import java.util.HashMap; |
4 |
import java.util.Map; |
5 |
|
6 |
import org.gvsig.exceptions.BaseException; |
7 |
import org.gvsig.fmap.geom.type.GeometryType; |
8 |
|
9 |
public class GeometryOperationNotSupportedException extends BaseException { |
10 |
|
11 |
private static final long serialVersionUID = 1L; |
12 |
private String geomTypeName = null; |
13 |
private int opCode = -1; |
14 |
|
15 |
public GeometryOperationNotSupportedException(int opCode, GeometryType geomType){ |
16 |
if (geomType != null) { |
17 |
geomTypeName = geomType.getName(); |
18 |
} |
19 |
this.opCode = opCode;
|
20 |
init(); |
21 |
} |
22 |
|
23 |
/**
|
24 |
* Initializes some values
|
25 |
*/
|
26 |
public void init() { |
27 |
messageKey = "Operation_opCode_is_not_registered_for_geomTypeName_type";
|
28 |
formatString = "Operation %(opCode)s is not registered for '%(geomTypeName)s' type.";
|
29 |
code = serialVersionUID; |
30 |
} |
31 |
|
32 |
/*
|
33 |
* (non-Javadoc)
|
34 |
* @see org.gvsig.exceptions.BaseException#values()
|
35 |
*/
|
36 |
protected Map values() { |
37 |
HashMap map = new HashMap(); |
38 |
map.put("opCode", Integer.toString(opCode)); |
39 |
map.put("geomTypeName", geomTypeName);
|
40 |
return map;
|
41 |
} |
42 |
|
43 |
} |