comparison backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java @ 7340:2ce7bacc940f double-precision

Merged changes from default into double precision branch.
author Tom Gottfried <tom@intevation.de>
date Tue, 15 Oct 2013 18:41:55 +0200
parents c5214e04b9b8 40e5ad76103c
children 588b02a4078a
comparison
equal deleted inserted replaced
7334:f7d3fc619976 7340:2ce7bacc940f
84 } 84 }
85 85
86 public void setWst(ImportWst wst) { 86 public void setWst(ImportWst wst) {
87 this.wst = wst; 87 this.wst = wst;
88 } 88 }
89
90 public static final class ParseException extends Exception {
91 public ParseException() {
92 }
93
94 public ParseException(String msg) {
95 super(msg);
96 }
97 } // class ParseException
89 98
90 /** Returns a new ImportTimeInterval with a date guessed from string. */ 99 /** Returns a new ImportTimeInterval with a date guessed from string. */
91 public static ImportTimeInterval guessDate(String string) { 100 public static ImportTimeInterval guessDate(String string) {
92 try { 101 try {
93 Matcher m = YEAR_INTERVAL.matcher(string); 102 Matcher m = YEAR_INTERVAL.matcher(string);
105 "' could not be interpreted as valid timestamp"); 114 "' could not be interpreted as valid timestamp");
106 } 115 }
107 return null; 116 return null;
108 } 117 }
109 118
110 public void parse(File file) throws IOException { 119 public void parse(File file) throws IOException, ParseException {
111 120
112 log.info("Parsing WST file '" + file + "'"); 121 log.info("Parsing WST file '" + file + "'");
113 122
114 if (wst == null) { 123 if (wst == null) {
115 wst = new ImportWst(file.getName()); 124 wst = new ImportWst(file.getName());
238 spezial = spezial.substring(COLUMN_QUELLE.length()).trim(); 247 spezial = spezial.substring(COLUMN_QUELLE.length()).trim();
239 if (spezial.length() == 0) { 248 if (spezial.length() == 0) {
240 continue; 249 continue;
241 } 250 }
242 quellen = StringUtil.splitQuoted(spezial, '"'); 251 quellen = StringUtil.splitQuoted(spezial, '"');
243 log.debug("sources: " + Arrays.toString(quellen)); 252 log.debug("sources: " + Arrays.toString(quellen));
244 } 253 }
245 else if (spezial.startsWith(COLUMN_DATUM)) { 254 else if (spezial.startsWith(COLUMN_DATUM)) {
246 spezial = spezial.substring(COLUMN_DATUM.length()).trim(); 255 spezial = spezial.substring(COLUMN_DATUM.length()).trim();
247 if (spezial.length() == 0) { 256 if (spezial.length() == 0) {
248 continue; 257 continue;

http://dive4elements.wald.intevation.org