Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/FeatureClassReader.java @ 121:9f74f4d36822
Set default values and improved logging and exception handling for map reader.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 16 Jun 2011 18:36:48 +0200 |
parents | ef7ca23c4233 |
children | 0bde090506f9 |
rev | line source |
---|---|
33
c51376f8e24c
Separated converter components into packages.
Raimund Renkert <rrenkert@intevation.de>
parents:
31
diff
changeset
|
1 package de.intevation.mxd.reader; |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 import java.io.IOException; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 import org.apache.log4j.Logger; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 import com.esri.arcgis.geodatabase.IClass; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 import com.esri.arcgis.geodatabase.FeatureClass; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 import org.w3c.dom.Node; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 /** |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 * Reads FeatureClass information. |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 * |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
17 public class FeatureClassReader |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
18 implements IClassReader { |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
20 /** |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
21 * The Logger. |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
22 */ |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
23 private static final Logger logger = |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
24 Logger.getLogger(FeatureClassReader.class); |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
25 |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
26 /** |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
27 * Private member. |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
28 */ |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
29 private IClass fclass; |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 private Node parent; |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
31 |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
32 |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
33 public FeatureClassReader(IClass cl) |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
34 throws Exception { |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
35 if(cl instanceof FeatureClass) { |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 this.fclass = cl; |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
37 } |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
38 else { |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
30
diff
changeset
|
39 throw new Exception("Not a FeatureClass object!" + |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
30
diff
changeset
|
40 cl.getClass().toString()); |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
41 } |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
44 /** |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
45 * Reads the Layer content. |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
46 * |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
47 * @return Currently always false. |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
48 */ |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
49 public boolean read() |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
50 throws IOException { |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
51 logger.debug("read() -> not implemented jet."); |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
52 return false; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
53 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
54 |
43
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
55 public void getClassDoc() |
ef7ca23c4233
Added comments, done some code styling and removed typos.
Raimund Renkert <rrenkert@intevation.de>
parents:
34
diff
changeset
|
56 throws IOException { |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
57 logger.debug("getLayer() -> not implemented jet."); |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
58 return; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
59 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
60 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
61 public void setXMLNode(Node node) { |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
62 parent = node; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
63 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
64 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
65 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |