diff backend/src/main/java/org/dive4elements/river/importer/parsers/AbstractSedimentLoadParser.java @ 8056:d86cc6a17b7a

Importer: Import sediment load at measurement stations.
author Tom Gottfried <tom@intevation.de>
date Fri, 18 Jul 2014 15:37:26 +0200
parents bd0dea643440
children bde5f5ec7c72
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/AbstractSedimentLoadParser.java	Fri Jul 18 13:03:28 2014 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/AbstractSedimentLoadParser.java	Fri Jul 18 15:37:26 2014 +0200
@@ -24,7 +24,6 @@
 import org.dive4elements.river.importer.ImporterSession;
 import org.dive4elements.river.importer.ImportGrainFraction;
 import org.dive4elements.river.importer.ImportTimeInterval;
-import org.dive4elements.river.importer.ImportUnit;
 
 import org.dive4elements.river.model.GrainFraction;
 
@@ -53,9 +52,6 @@
     public static final Pattern META_FRACTION_NAME =
         Pattern.compile("^Fraktionsname: (.*)");
 
-    public static final Pattern META_UNIT =
-        Pattern.compile("^Einheit: \\[(.*)\\].*");
-
     public static final Pattern META_COLUMN_NAMES =
         Pattern.compile("^Fluss-km.*");
 
@@ -69,11 +65,12 @@
      * with respect to file location (offical epoch or not?) */
     protected abstract void initializeSedimentLoads();
 
+    protected abstract void handleMetaLine(String line)
+        throws LineParserException;
+
 
     protected ImportGrainFraction grainFraction;
 
-    protected ImportUnit unit;
-
     protected String description;
 
     protected String[] columnNames;
@@ -102,35 +99,6 @@
     }
 
 
-    protected void handleMetaLine(String line) throws LineParserException {
-        if (handleMetaUnit(line)) {
-            return;
-        }
-        if (handleMetaFraction(line)) {
-            return;
-        }
-        if (handleMetaFractionName(line)) {
-            return;
-        }
-        if (handleColumnNames(line)) {
-            return;
-        }
-        log.warn("ASLP: Unknown meta line: '" + line + "'");
-    }
-
-
-    protected boolean handleMetaUnit(String line) {
-        Matcher m = META_UNIT.matcher(line);
-
-        if (m.matches()) {
-            unit = new ImportUnit(m.group(1));
-            return true;
-        }
-
-        return false;
-    }
-
-
     public boolean handleMetaFraction(String line) {
         Matcher m = META_FRACTION.matcher(line);
 

http://dive4elements.wald.intevation.org