changeset 7087:ada424214b02 generator-refactoring

Use Object instead of DOM Element as argument for setup of out generators. First step to remove dependency to XML DOM when using configuration.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 22 Sep 2013 21:05:12 +0200
parents 42e243c640a0
children 41567bf1e131
files artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java artifacts/src/main/java/org/dive4elements/river/exports/ChartInfoGenerator.java artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java artifacts/src/main/java/org/dive4elements/river/exports/OutGenerator.java artifacts/src/main/java/org/dive4elements/river/exports/ReportGenerator.java artifacts/src/main/java/org/dive4elements/river/exports/ShapeExporter.java artifacts/src/main/java/org/dive4elements/river/exports/sq/SQOverviewGenerator.java
diffstat 10 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java	Sun Sep 22 21:05:12 2013 +0200
@@ -55,7 +55,7 @@
     }
 
     @Override
-    public void setup(Element config) {
+    public void setup(Object config) {
         logger.debug("ATExporter.setup");
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/AbstractExporter.java	Sun Sep 22 21:05:12 2013 +0200
@@ -119,7 +119,7 @@
      */
     protected abstract void addData(Object data);
 
-    public void setup(Element config) {
+    public void setup(Object config) {
         logger.debug("AbstractExporter.setup");
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java	Sun Sep 22 21:05:12 2013 +0200
@@ -162,7 +162,7 @@
     }
 
     @Override
-    public void setup(Element config) {
+    public void setup(Object config) {
         logger.debug("ChartGenerator.setup");
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartInfoGenerator.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartInfoGenerator.java	Sun Sep 22 21:05:12 2013 +0200
@@ -70,7 +70,7 @@
         this.generator = generator;
     }
 
-    public void setup(Element config) {
+    public void setup(Object config) {
         logger.debug("ChartInfoGenerator.setup");
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Sun Sep 22 21:05:12 2013 +0200
@@ -104,11 +104,12 @@
     }
 
     @Override
-    public void setup(Element config) {
+    public void setup(Object config) {
+        Element cfg = (Element)config;
         logger.debug("DiagramGenerator.setup");
         // TODO: XML DOM is not thread safe! We have to re-factor this.
-        synchronized (config.getOwnerDocument()) {
-            diagramAttributes = new DiagramAttributes(config);
+        synchronized (cfg.getOwnerDocument()) {
+            diagramAttributes = new DiagramAttributes(cfg);
         }
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Sun Sep 22 21:05:12 2013 +0200
@@ -68,7 +68,7 @@
     protected String outName;
 
     @Override
-    public void setup(Element config) {
+    public void setup(Object config) {
         logger.debug("MapGenerator.setup");
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/OutGenerator.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/OutGenerator.java	Sun Sep 22 21:05:12 2013 +0200
@@ -32,7 +32,7 @@
     /**
      * Pre-initialize generator from configuration.
      */
-    void setup(Element config);
+    void setup(Object config);
 
     /**
      * Initializes the OutGenerator with meta information which are necessary
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ReportGenerator.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ReportGenerator.java	Sun Sep 22 21:05:12 2013 +0200
@@ -43,7 +43,7 @@
     }
 
     @Override
-    public void setup(Element config) {
+    public void setup(Object config) {
         logger.debug("ReportGenerator.setup");
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ShapeExporter.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ShapeExporter.java	Sun Sep 22 21:05:12 2013 +0200
@@ -33,7 +33,7 @@
     private String outName;
 
     @Override
-    public void setup(Element config) {
+    public void setup(Object config) {
         logger.debug("ShapeExporter.setup");
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQOverviewGenerator.java	Sun Sep 22 17:15:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQOverviewGenerator.java	Sun Sep 22 21:05:12 2013 +0200
@@ -65,7 +65,7 @@
     protected String outName;
 
     @Override
-    public void setup(Element config) {
+    public void setup(Object config) {
         logger.debug("SQOverviewGenerator.setup");
     }
 

http://dive4elements.wald.intevation.org