Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/parsers/MeasurementStationsParser.java @ 8665:8fbc0649da13
Move static measurement types to their natural home.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 08 Apr 2015 14:47:30 +0200 |
parents | 9db1f48bfea9 |
children | 2693bfaf503d 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8664:b9e5fa7f7a28 | 8665:8fbc0649da13 |
---|---|
14 import java.util.Date; | 14 import java.util.Date; |
15 import java.util.List; | 15 import java.util.List; |
16 | 16 |
17 import org.apache.log4j.Logger; | 17 import org.apache.log4j.Logger; |
18 | 18 |
19 import org.dive4elements.river.model.MeasurementStation; | |
20 | |
19 import org.dive4elements.river.importer.ImportMeasurementStation; | 21 import org.dive4elements.river.importer.ImportMeasurementStation; |
20 import org.dive4elements.river.importer.ImportRange; | 22 import org.dive4elements.river.importer.ImportRange; |
21 import org.dive4elements.river.importer.ImportTimeInterval; | 23 import org.dive4elements.river.importer.ImportTimeInterval; |
22 | 24 |
23 | 25 |
33 } | 35 } |
34 | 36 |
35 public static final int MIN_COLUMNS = 9; | 37 public static final int MIN_COLUMNS = 9; |
36 | 38 |
37 public static final int MAX_COMMENT_LENGTH = 512; | 39 public static final int MAX_COMMENT_LENGTH = 512; |
38 | |
39 public static final String MEASUREMENT_TYPE_BEDLOAD = "Geschiebe"; | |
40 public static final String MEASUREMENT_TYPE_SUSP = "Schwebstoff"; | |
41 | 40 |
42 private static final Logger log = Logger | 41 private static final Logger log = Logger |
43 .getLogger(MeasurementStationsParser.class); | 42 .getLogger(MeasurementStationsParser.class); |
44 | 43 |
45 private List<ImportMeasurementStation> measurementStations; | 44 private List<ImportMeasurementStation> measurementStations; |
142 } | 141 } |
143 | 142 |
144 protected String getMeasurementType(String[] cols, int lineNum) | 143 protected String getMeasurementType(String[] cols, int lineNum) |
145 throws MeasurementStationParserException { | 144 throws MeasurementStationParserException { |
146 String mtype = cols[2].trim(); | 145 String mtype = cols[2].trim(); |
147 if (!(MEASUREMENT_TYPE_BEDLOAD.equals(mtype) || | 146 if (!(MeasurementStation.MEASUREMENT_TYPE_BEDLOAD.equals(mtype) || |
148 MEASUREMENT_TYPE_SUSP.equals(mtype))) { | 147 MeasurementStation.MEASUREMENT_TYPE_SUSP.equals(mtype))) { |
149 throw new MeasurementStationParserException( | 148 throw new MeasurementStationParserException( |
150 "invalid measurement type in line " + lineNum); | 149 "invalid measurement type in line " + lineNum); |
151 } | 150 } |
152 | 151 |
153 return mtype; | 152 return mtype; |