comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/FlowVelocityModelParser.java @ 5689:a3f7da9bf0d1

Set description when importing flow velocity models
author Tom Gottfried <tom.gottfried@intevation.de>
date Fri, 12 Apr 2013 19:51:44 +0200
parents b3dd14fc13a6
children 53134ccc4a64
comparison
equal deleted inserted replaced
5683:545a6ace9a19 5689:a3f7da9bf0d1
1 package de.intevation.flys.importer.parsers; 1 package de.intevation.flys.importer.parsers;
2
3 import java.io.File;
4 import java.io.IOException;
2 5
3 import java.math.BigDecimal; 6 import java.math.BigDecimal;
4 import java.text.NumberFormat; 7 import java.text.NumberFormat;
5 import java.text.ParseException; 8 import java.text.ParseException;
6 import java.util.ArrayList; 9 import java.util.ArrayList;
47 50
48 private List<ImportFlowVelocityModel> models; 51 private List<ImportFlowVelocityModel> models;
49 52
50 private ImportFlowVelocityModel current; 53 private ImportFlowVelocityModel current;
51 54
55 protected String description;
56
52 57
53 public FlowVelocityModelParser() { 58 public FlowVelocityModelParser() {
54 models = new ArrayList<ImportFlowVelocityModel>(); 59 models = new ArrayList<ImportFlowVelocityModel>();
55 } 60 }
56 61
58 public List<ImportFlowVelocityModel> getModels() { 63 public List<ImportFlowVelocityModel> getModels() {
59 return models; 64 return models;
60 } 65 }
61 66
62 @Override 67 @Override
68 public void parse(File file) throws IOException {
69 description = file.getName();
70
71 super.parse(file);
72 }
73
74 @Override
63 protected void reset() { 75 protected void reset() {
64 current = new ImportFlowVelocityModel(); 76 current = new ImportFlowVelocityModel(description);
65 } 77 }
66 78
67 79
68 @Override 80 @Override
69 protected void finish() { 81 protected void finish() {
70 models.add(current); 82 models.add(current);
83
84 // description = null;
71 } 85 }
72 86
73 87
74 @Override 88 @Override
75 protected void handleLine(int lineNum, String line) { 89 protected void handleLine(int lineNum, String line) {

http://dive4elements.wald.intevation.org