Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/FeatureClassReader.java @ 31:40c0b4e5f91a
Added utility class to store map attributes.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Mon, 11 Apr 2011 16:04:03 +0200 |
parents | c34c450edb06 |
children | c51376f8e24c |
rev | line source |
---|---|
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 //package de.intevation.mxd.reader; |
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.Attr; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 import org.w3c.dom.Document; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 import org.w3c.dom.Element; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 import org.w3c.dom.Node; |
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 /** |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 * Reads FeatureClass information. |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 * |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 */ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 public class FeatureClassReader implements IClassReader{ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 private static final Logger logger = Logger.getLogger(FeatureClassReader.class); |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 private IClass fclass; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 private Node parent; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 //Constructor |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 public FeatureClassReader(IClass cl) throws Exception{ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 if(cl instanceof FeatureClass) |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 this.fclass = cl; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 else |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
30
diff
changeset
|
32 throw new Exception("Not a FeatureClass object!" + |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
30
diff
changeset
|
33 cl.getClass().toString()); |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 //Methods |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 /** |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 * Reads the Layer content. |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 */ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 public boolean read() throws IOException{ |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
30
diff
changeset
|
41 |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 logger.debug("read()"); |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 return false; |
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 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
46 public void getClassDoc() throws IOException{ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
47 logger.debug("getLayer() -> not implemented jet."); |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
48 return; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
49 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
50 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
51 public void setXMLNode(Node node) { |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
52 parent = node; |
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 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |