Mercurial > mxd2map
annotate src/java/de/intevation/mxd/reader/FeatureClassReader.java @ 37:c14a92c7628d
Added a new mapserver wrapper cgi script for testing of generated map from
bsh-mxd-converter.
author | Bjoern Schilberg <bjoern@intevation.de> |
---|---|
date | Wed, 13 Apr 2011 16:38:03 +0200 |
parents | 7a927921eb6c |
children | ef7ca23c4233 |
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 */ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 public class FeatureClassReader implements IClassReader{ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 private static final Logger logger = Logger.getLogger(FeatureClassReader.class); |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 private IClass fclass; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 private Node parent; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 //Constructor |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 public FeatureClassReader(IClass cl) throws Exception{ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 if(cl instanceof FeatureClass) |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 this.fclass = cl; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 else |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
30
diff
changeset
|
29 throw new Exception("Not a FeatureClass object!" + |
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
30
diff
changeset
|
30 cl.getClass().toString()); |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 //Methods |
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 * Reads the Layer content. |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 */ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 public boolean read() throws IOException{ |
31
40c0b4e5f91a
Added utility class to store map attributes.
Raimund Renkert <rrenkert@intevation.de>
parents:
30
diff
changeset
|
38 |
30
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 logger.debug("read()"); |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 return false; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 } |
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 public void getClassDoc() throws IOException{ |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
44 logger.debug("getLayer() -> not implemented jet."); |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
45 return; |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
46 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
47 |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
48 public void setXMLNode(Node node) { |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
49 parent = node; |
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 } |
c34c450edb06
Introduced class reader.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
52 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |