Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/importer/laf/LafObjectListener.java @ 1146:5eb9d35aa47a
Parse, map and merge orte.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Mon, 07 Nov 2016 10:09:22 +0100 |
parents | b2c3a59b40f8 |
children | 315df94c679b |
comparison
equal
deleted
inserted
replaced
1145:cbdeac32465c | 1146:5eb9d35aa47a |
---|---|
14 public class LafObjectListener extends LafBaseListener { | 14 public class LafObjectListener extends LafBaseListener { |
15 | 15 |
16 LafRawData data; | 16 LafRawData data; |
17 LafRawData.Probe currentProbe; | 17 LafRawData.Probe currentProbe; |
18 LafRawData.Messung currentMessung; | 18 LafRawData.Messung currentMessung; |
19 Map<String, String> currentUOrt; | |
20 Map<String, String> currentEOrt; | |
19 Map<String, List<ReportItem>> errors; | 21 Map<String, List<ReportItem>> errors; |
20 ArrayList<ReportItem> currentErrors; | 22 ArrayList<ReportItem> currentErrors; |
21 | 23 |
22 private boolean hasDatenbasis = false; | 24 private boolean hasDatenbasis = false; |
23 private boolean hasMessprogramm = false; | 25 private boolean hasMessprogramm = false; |
24 private boolean hasUmwelt = false; | 26 private boolean hasUmwelt = false; |
25 private boolean hasZeitbasis = false; | 27 private boolean hasZeitbasis = false; |
26 private boolean hasUebertragungsformat = false; | 28 private boolean hasUebertragungsformat = false; |
27 private boolean hasVersion = false; | 29 private boolean hasVersion = false; |
28 | 30 private boolean hasEHerkunfstland = false; |
31 private boolean hasEGemeinde = false; | |
32 private boolean hasEKoordinaten = false; | |
33 private boolean hasUHerkunfstland = false; | |
34 private boolean hasUGemeinde = false; | |
35 private boolean hasUKoordinaten = false; | |
29 | 36 |
30 public LafObjectListener() { | 37 public LafObjectListener() { |
31 data = new LafRawData(); | 38 data = new LafRawData(); |
32 errors = new HashMap<String, List<ReportItem>>(); | 39 errors = new HashMap<String, List<ReportItem>>(); |
33 currentErrors = new ArrayList<ReportItem>(); | 40 currentErrors = new ArrayList<ReportItem>(); |
41 currentUOrt = new HashMap<String, String>(); | |
34 } | 42 } |
35 | 43 |
36 public LafRawData getData() { | 44 public LafRawData getData() { |
37 return data; | 45 return data; |
38 } | 46 } |
104 @Override public void enterProbe(LafParser.ProbeContext ctx) { | 112 @Override public void enterProbe(LafParser.ProbeContext ctx) { |
105 if (currentMessung != null) { | 113 if (currentMessung != null) { |
106 currentProbe.addMessung(currentMessung); | 114 currentProbe.addMessung(currentMessung); |
107 currentMessung = null; | 115 currentMessung = null; |
108 } | 116 } |
117 if (currentUOrt != null && !currentUOrt.isEmpty()) { | |
118 currentProbe.addUrsprungsOrt(currentUOrt); | |
119 currentUOrt.clear(); | |
120 } | |
121 if (currentEOrt != null && !currentEOrt.isEmpty()) { | |
122 currentProbe.addEntnahmeOrt(currentEOrt); | |
123 currentEOrt.clear(); | |
124 } | |
125 currentEOrt = new HashMap<String, String>(); | |
109 currentProbe = data.new Probe(); | 126 currentProbe = data.new Probe(); |
110 } | 127 } |
111 | 128 |
112 /** | 129 /** |
113 * {@inheritDoc} | 130 * {@inheritDoc} |
139 /** | 156 /** |
140 * {@inheritDoc} | 157 * {@inheritDoc} |
141 * | 158 * |
142 * <p>The default implementation does nothing.</p> | 159 * <p>The default implementation does nothing.</p> |
143 */ | 160 */ |
144 @Override public void enterUs(LafParser.UsContext ctx) { | |
145 } | |
146 | |
147 /** | |
148 * {@inheritDoc} | |
149 * | |
150 * <p>The default implementation does nothing.</p> | |
151 */ | |
152 @Override public void enterMp(LafParser.MpContext ctx) { | 161 @Override public void enterMp(LafParser.MpContext ctx) { |
153 } | 162 } |
154 | 163 |
155 /** | 164 /** |
156 * {@inheritDoc} | 165 * {@inheritDoc} |
271 */ | 280 */ |
272 @Override public void enterMessung(LafParser.MessungContext ctx) { | 281 @Override public void enterMessung(LafParser.MessungContext ctx) { |
273 if (currentMessung != null) { | 282 if (currentMessung != null) { |
274 currentProbe.addMessung(currentMessung); | 283 currentProbe.addMessung(currentMessung); |
275 } | 284 } |
285 if (currentUOrt != null && !currentUOrt.isEmpty()) { | |
286 currentProbe.addUrsprungsOrt(currentUOrt); | |
287 currentUOrt.clear(); | |
288 } | |
289 if (currentEOrt != null && !currentEOrt.isEmpty()) { | |
290 currentProbe.addEntnahmeOrt(currentEOrt); | |
291 currentEOrt.clear(); | |
292 } | |
276 currentMessung = data.new Messung(); | 293 currentMessung = data.new Messung(); |
277 } | 294 } |
278 | 295 |
279 /** | 296 /** |
280 * {@inheritDoc} | 297 * {@inheritDoc} |
289 /** | 306 /** |
290 * {@inheritDoc} | 307 * {@inheritDoc} |
291 * | 308 * |
292 * <p>The default implementation does nothing.</p> | 309 * <p>The default implementation does nothing.</p> |
293 */ | 310 */ |
311 @Override public void enterUrsprungsort(LafParser.UrsprungsortContext ctx) { | |
312 if (currentMessung != null) { | |
313 currentProbe.addMessung(currentMessung); | |
314 currentMessung = data.new Messung(); | |
315 } | |
316 if (currentUOrt != null && !currentUOrt.isEmpty()) { | |
317 currentProbe.addUrsprungsOrt(currentUOrt); | |
318 } | |
319 if (currentEOrt != null && !currentEOrt.isEmpty()) { | |
320 currentProbe.addEntnahmeOrt(currentEOrt); | |
321 currentEOrt.clear(); | |
322 } | |
323 currentUOrt.clear(); | |
324 } | |
325 | |
326 /** | |
327 * {@inheritDoc} | |
328 * | |
329 * <p>The default implementation does nothing.</p> | |
330 */ | |
331 @Override public void exitUrsprungsort(LafParser.UrsprungsortContext ctx) { | |
332 } | |
333 | |
334 | |
335 /** | |
336 * {@inheritDoc} | |
337 * | |
338 * <p>The default implementation does nothing.</p> | |
339 */ | |
294 @Override public void enterMm(LafParser.MmContext ctx) { | 340 @Override public void enterMm(LafParser.MmContext ctx) { |
295 } | 341 } |
296 | 342 |
297 /** | 343 /** |
298 * {@inheritDoc} | 344 * {@inheritDoc} |
1236 err.setValue(value); | 1282 err.setValue(value); |
1237 err.setCode(670); | 1283 err.setCode(670); |
1238 currentErrors.add(err);; | 1284 currentErrors.add(err);; |
1239 return; | 1285 return; |
1240 } | 1286 } |
1287 currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1288 hasUHerkunfstland = true; | |
1241 // TODO: Add to "ursprungsort" | 1289 // TODO: Add to "ursprungsort" |
1242 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1290 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1243 } | 1291 } |
1244 | 1292 |
1245 /** | 1293 /** |
1259 err.setValue(value); | 1307 err.setValue(value); |
1260 err.setCode(670); | 1308 err.setCode(670); |
1261 currentErrors.add(err);; | 1309 currentErrors.add(err);; |
1262 return; | 1310 return; |
1263 } | 1311 } |
1312 currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1313 hasUHerkunfstland = true; | |
1264 // TODO: Add to "ursprungsort" | 1314 // TODO: Add to "ursprungsort" |
1265 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1315 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1266 } | 1316 } |
1267 | 1317 |
1268 /** | 1318 /** |
1282 err.setValue(value); | 1332 err.setValue(value); |
1283 err.setCode(670); | 1333 err.setCode(670); |
1284 currentErrors.add(err);; | 1334 currentErrors.add(err);; |
1285 return; | 1335 return; |
1286 } | 1336 } |
1337 currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1338 hasUHerkunfstland = true; | |
1287 // TODO: Add to "ursprungsort" | 1339 // TODO: Add to "ursprungsort" |
1288 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1340 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1289 } | 1341 } |
1290 | 1342 |
1291 /** | 1343 /** |
1305 err.setValue(value); | 1357 err.setValue(value); |
1306 err.setCode(670); | 1358 err.setCode(670); |
1307 currentErrors.add(err);; | 1359 currentErrors.add(err);; |
1308 return; | 1360 return; |
1309 } | 1361 } |
1362 currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1363 hasUGemeinde= true; | |
1310 // TODO: Add to "ursprungsort" | 1364 // TODO: Add to "ursprungsort" |
1311 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1365 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1312 } | 1366 } |
1313 | 1367 |
1314 /** | 1368 /** |
1328 err.setValue(value); | 1382 err.setValue(value); |
1329 err.setCode(670); | 1383 err.setCode(670); |
1330 currentErrors.add(err);; | 1384 currentErrors.add(err);; |
1331 return; | 1385 return; |
1332 } | 1386 } |
1387 currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1388 hasUGemeinde= true; | |
1333 // TODO: Add to "ursprungsort" | 1389 // TODO: Add to "ursprungsort" |
1334 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1390 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1335 } | 1391 } |
1336 | 1392 |
1337 /** | 1393 /** |
1351 err.setValue(value); | 1407 err.setValue(value); |
1352 err.setCode(670); | 1408 err.setCode(670); |
1353 currentErrors.add(err);; | 1409 currentErrors.add(err);; |
1354 return; | 1410 return; |
1355 } | 1411 } |
1412 currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1356 // TODO: Add to "ursprungsort" | 1413 // TODO: Add to "ursprungsort" |
1357 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1414 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1358 } | 1415 } |
1359 | 1416 |
1360 /** | 1417 /** |
1394 err.setValue(koord2); | 1451 err.setValue(koord2); |
1395 err.setCode(670); | 1452 err.setCode(670); |
1396 currentErrors.add(err);; | 1453 currentErrors.add(err);; |
1397 return; | 1454 return; |
1398 } | 1455 } |
1456 currentUOrt.put("U_KOORDINATEN_X", koord1); | |
1457 currentUOrt.put("U_KOORDINATEN_Y", koord2); | |
1458 currentUOrt.put("U_KOORDINATEN_ART", art); | |
1459 hasUKoordinaten = true; | |
1399 // TODO: Add to "ursprungsort" | 1460 // TODO: Add to "ursprungsort" |
1400 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1461 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1401 } | 1462 } |
1402 | 1463 |
1403 /** | 1464 /** |
1404 * {@inheritDoc} | 1465 * {@inheritDoc} |
1405 * | 1466 * |
1406 * <p>The default implementation does nothing.</p> | 1467 * <p>The default implementation does nothing.</p> |
1407 */ | 1468 */ |
1408 @Override public void enterU_koordinaten_s(LafParser.U_koordinaten_sContext ctx) { | 1469 @Override public void enterU_koordinaten_s(LafParser.U_koordinaten_sContext ctx) { |
1470 System.out.println("koordinaten"); | |
1409 if (ctx.getChildCount() < 6) { | 1471 if (ctx.getChildCount() < 6) { |
1410 return; | 1472 return; |
1411 } | 1473 } |
1412 String art = ctx.getChild(1).toString(); | 1474 String art = ctx.getChild(1).toString(); |
1413 art = art.replaceAll("\"", ""); | 1475 art = art.replaceAll("\"", ""); |
1437 err.setValue(koord2); | 1499 err.setValue(koord2); |
1438 err.setCode(670); | 1500 err.setCode(670); |
1439 currentErrors.add(err);; | 1501 currentErrors.add(err);; |
1440 return; | 1502 return; |
1441 } | 1503 } |
1504 System.out.println("add"); | |
1505 currentUOrt.put("U_KOORDINATEN_X", koord1); | |
1506 currentUOrt.put("U_KOORDINATEN_Y", koord2); | |
1507 currentUOrt.put("U_KOORDINATEN_ART_S", art); | |
1508 hasUKoordinaten = true; | |
1442 // TODO: Add to "ursprungsort" | 1509 // TODO: Add to "ursprungsort" |
1443 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1510 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1444 } | 1511 } |
1445 | 1512 |
1446 /** | 1513 /** |
1460 err.setValue(value); | 1527 err.setValue(value); |
1461 err.setCode(670); | 1528 err.setCode(670); |
1462 currentErrors.add(err); | 1529 currentErrors.add(err); |
1463 return; | 1530 return; |
1464 } | 1531 } |
1532 currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1465 // TODO: Add to "ursprungsort" | 1533 // TODO: Add to "ursprungsort" |
1466 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1534 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1467 } | 1535 } |
1468 | 1536 |
1469 /** | 1537 /** |
1483 err.setValue(value); | 1551 err.setValue(value); |
1484 err.setCode(670); | 1552 err.setCode(670); |
1485 currentErrors.add(err);; | 1553 currentErrors.add(err);; |
1486 return; | 1554 return; |
1487 } | 1555 } |
1556 currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1488 // TODO: Add to "ursprungsort" | 1557 // TODO: Add to "ursprungsort" |
1489 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1558 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1490 } | 1559 } |
1491 | 1560 |
1492 /** | 1561 /** |
1506 err.setValue(value); | 1575 err.setValue(value); |
1507 err.setCode(670); | 1576 err.setCode(670); |
1508 currentErrors.add(err);; | 1577 currentErrors.add(err);; |
1509 return; | 1578 return; |
1510 } | 1579 } |
1580 currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1511 // TODO: Add to "ursprungsort" | 1581 // TODO: Add to "ursprungsort" |
1512 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1582 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1513 } | 1583 } |
1514 | 1584 |
1515 /** | 1585 /** |
1516 * {@inheritDoc} | 1586 * {@inheritDoc} |
1517 * | 1587 * |
1518 * <p>The default implementation does nothing.</p> | 1588 * <p>The default implementation does nothing.</p> |
1519 */ | 1589 */ |
1520 @Override public void enterP_herkunftsland_lang(LafParser.P_herkunftsland_langContext ctx) { | 1590 @Override public void enterP_herkunftsland_lang(LafParser.P_herkunftsland_langContext ctx) { |
1591 if (hasEHerkunfstland) { | |
1592 return; | |
1593 } | |
1521 if (ctx.getChildCount() < 2) { | 1594 if (ctx.getChildCount() < 2) { |
1522 return; | 1595 return; |
1523 } | 1596 } |
1524 String value = ctx.getChild(1).toString(); | 1597 String value = ctx.getChild(1).toString(); |
1525 value = value.replaceAll("\"", ""); | 1598 value = value.replaceAll("\"", ""); |
1529 err.setValue(value); | 1602 err.setValue(value); |
1530 err.setCode(670); | 1603 err.setCode(670); |
1531 currentErrors.add(err);; | 1604 currentErrors.add(err);; |
1532 return; | 1605 return; |
1533 } | 1606 } |
1607 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1608 hasEHerkunfstland = true; | |
1534 // TODO: Add to "entnahmeort" | 1609 // TODO: Add to "entnahmeort" |
1535 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1610 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1536 } | 1611 } |
1537 | 1612 |
1538 /** | 1613 /** |
1539 * {@inheritDoc} | 1614 * {@inheritDoc} |
1540 * | 1615 * |
1541 * <p>The default implementation does nothing.</p> | 1616 * <p>The default implementation does nothing.</p> |
1542 */ | 1617 */ |
1543 @Override public void enterP_herkunftsland_kurz(LafParser.P_herkunftsland_kurzContext ctx) { | 1618 @Override public void enterP_herkunftsland_kurz(LafParser.P_herkunftsland_kurzContext ctx) { |
1619 if (hasEHerkunfstland) { | |
1620 return; | |
1621 } | |
1544 if (ctx.getChildCount() < 2) { | 1622 if (ctx.getChildCount() < 2) { |
1545 return; | 1623 return; |
1546 } | 1624 } |
1547 String value = ctx.getChild(1).toString(); | 1625 String value = ctx.getChild(1).toString(); |
1548 value = value.replaceAll("\"", ""); | 1626 value = value.replaceAll("\"", ""); |
1552 err.setValue(value); | 1630 err.setValue(value); |
1553 err.setCode(670); | 1631 err.setCode(670); |
1554 currentErrors.add(err);; | 1632 currentErrors.add(err);; |
1555 return; | 1633 return; |
1556 } | 1634 } |
1635 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1636 hasEHerkunfstland = true; | |
1557 // TODO: Add to "entnahmeort" | 1637 // TODO: Add to "entnahmeort" |
1558 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1638 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1559 } | 1639 } |
1560 | 1640 |
1561 /** | 1641 /** |
1562 * {@inheritDoc} | 1642 * {@inheritDoc} |
1563 * | 1643 * |
1564 * <p>The default implementation does nothing.</p> | 1644 * <p>The default implementation does nothing.</p> |
1565 */ | 1645 */ |
1566 @Override public void enterP_herkunftsland_s(LafParser.P_herkunftsland_sContext ctx) { | 1646 @Override public void enterP_herkunftsland_s(LafParser.P_herkunftsland_sContext ctx) { |
1647 if (hasEHerkunfstland) { | |
1648 return; | |
1649 } | |
1567 if (ctx.getChildCount() < 2) { | 1650 if (ctx.getChildCount() < 2) { |
1568 return; | 1651 return; |
1569 } | 1652 } |
1570 String value = ctx.getChild(1).toString(); | 1653 String value = ctx.getChild(1).toString(); |
1571 value = value.replaceAll("\"", ""); | 1654 value = value.replaceAll("\"", ""); |
1575 err.setValue(value); | 1658 err.setValue(value); |
1576 err.setCode(670); | 1659 err.setCode(670); |
1577 currentErrors.add(err);; | 1660 currentErrors.add(err);; |
1578 return; | 1661 return; |
1579 } | 1662 } |
1663 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1664 hasEHerkunfstland = true; | |
1580 // TODO: Add to "entnahmeort" | 1665 // TODO: Add to "entnahmeort" |
1581 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1666 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1582 } | 1667 } |
1583 | 1668 |
1584 /** | 1669 /** |
1585 * {@inheritDoc} | 1670 * {@inheritDoc} |
1586 * | 1671 * |
1587 * <p>The default implementation does nothing.</p> | 1672 * <p>The default implementation does nothing.</p> |
1588 */ | 1673 */ |
1589 @Override public void enterP_gemeindeschluessel(LafParser.P_gemeindeschluesselContext ctx) { | 1674 @Override public void enterP_gemeindeschluessel(LafParser.P_gemeindeschluesselContext ctx) { |
1675 if (hasEGemeinde) { | |
1676 return; | |
1677 } | |
1590 if (ctx.getChildCount() < 2) { | 1678 if (ctx.getChildCount() < 2) { |
1591 return; | 1679 return; |
1592 } | 1680 } |
1593 String value = ctx.getChild(1).toString(); | 1681 String value = ctx.getChild(1).toString(); |
1594 value = value.replaceAll("\"", ""); | 1682 value = value.replaceAll("\"", ""); |
1598 err.setValue(value); | 1686 err.setValue(value); |
1599 err.setCode(670); | 1687 err.setCode(670); |
1600 currentErrors.add(err);; | 1688 currentErrors.add(err);; |
1601 return; | 1689 return; |
1602 } | 1690 } |
1691 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1692 hasEGemeinde = true; | |
1603 // TODO: Add to "entnahmeort" | 1693 // TODO: Add to "entnahmeort" |
1604 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1694 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1605 } | 1695 } |
1606 | 1696 |
1607 /** | 1697 /** |
1608 * {@inheritDoc} | 1698 * {@inheritDoc} |
1609 * | 1699 * |
1610 * <p>The default implementation does nothing.</p> | 1700 * <p>The default implementation does nothing.</p> |
1611 */ | 1701 */ |
1612 @Override public void enterP_gemeindename(LafParser.P_gemeindenameContext ctx) { | 1702 @Override public void enterP_gemeindename(LafParser.P_gemeindenameContext ctx) { |
1703 if (hasEGemeinde) { | |
1704 return; | |
1705 } | |
1613 if (ctx.getChildCount() < 2) { | 1706 if (ctx.getChildCount() < 2) { |
1614 return; | 1707 return; |
1615 } | 1708 } |
1616 String value = ctx.getChild(1).toString(); | 1709 String value = ctx.getChild(1).toString(); |
1617 value = value.replaceAll("\"", ""); | 1710 value = value.replaceAll("\"", ""); |
1621 err.setValue(value); | 1714 err.setValue(value); |
1622 err.setCode(670); | 1715 err.setCode(670); |
1623 currentErrors.add(err);; | 1716 currentErrors.add(err);; |
1624 return; | 1717 return; |
1625 } | 1718 } |
1719 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1720 hasEGemeinde = true; | |
1626 // TODO: Add to "entnahmeort" | 1721 // TODO: Add to "entnahmeort" |
1627 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1722 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1628 } | 1723 } |
1629 | 1724 |
1630 /** | 1725 /** |
1644 err.setValue(value); | 1739 err.setValue(value); |
1645 err.setCode(670); | 1740 err.setCode(670); |
1646 currentErrors.add(err);; | 1741 currentErrors.add(err);; |
1647 return; | 1742 return; |
1648 } | 1743 } |
1744 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1649 // TODO: Add to "entnahmeort" | 1745 // TODO: Add to "entnahmeort" |
1650 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1746 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1651 } | 1747 } |
1652 | 1748 |
1653 /** | 1749 /** |
1654 * {@inheritDoc} | 1750 * {@inheritDoc} |
1655 * | 1751 * |
1656 * <p>The default implementation does nothing.</p> | 1752 * <p>The default implementation does nothing.</p> |
1657 */ | 1753 */ |
1658 @Override public void enterP_koordinaten(LafParser.P_koordinatenContext ctx) { | 1754 @Override public void enterP_koordinaten(LafParser.P_koordinatenContext ctx) { |
1755 if (hasEKoordinaten) { | |
1756 return; | |
1757 } | |
1659 if (ctx.getChildCount() < 6) { | 1758 if (ctx.getChildCount() < 6) { |
1660 return; | 1759 return; |
1661 } | 1760 } |
1662 String art = ctx.getChild(1).toString(); | 1761 String art = ctx.getChild(1).toString(); |
1663 art = art.replaceAll("\"", ""); | 1762 art = art.replaceAll("\"", ""); |
1687 err.setValue(koord2); | 1786 err.setValue(koord2); |
1688 err.setCode(670); | 1787 err.setCode(670); |
1689 currentErrors.add(err);; | 1788 currentErrors.add(err);; |
1690 return; | 1789 return; |
1691 } | 1790 } |
1791 currentEOrt.put("P_KOORDINATEN_X", koord1); | |
1792 currentEOrt.put("P_KOORDINATEN_Y", koord2); | |
1793 currentEOrt.put("P_KOORDINATEN_ART", art); | |
1794 hasEKoordinaten = true; | |
1692 // TODO: Add to "entnahmeort" | 1795 // TODO: Add to "entnahmeort" |
1693 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1796 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1694 } | 1797 } |
1695 | 1798 |
1696 /** | 1799 /** |
1697 * {@inheritDoc} | 1800 * {@inheritDoc} |
1698 * | 1801 * |
1699 * <p>The default implementation does nothing.</p> | 1802 * <p>The default implementation does nothing.</p> |
1700 */ | 1803 */ |
1701 @Override public void enterP_koordinaten_s(LafParser.P_koordinaten_sContext ctx) { | 1804 @Override public void enterP_koordinaten_s(LafParser.P_koordinaten_sContext ctx) { |
1805 if (hasEKoordinaten) { | |
1806 return; | |
1807 } | |
1702 if (ctx.getChildCount() < 6) { | 1808 if (ctx.getChildCount() < 6) { |
1703 return; | 1809 return; |
1704 } | 1810 } |
1705 String art = ctx.getChild(1).toString(); | 1811 String art = ctx.getChild(1).toString(); |
1706 art = art.replaceAll("\"", ""); | 1812 art = art.replaceAll("\"", ""); |
1730 err.setValue(koord2); | 1836 err.setValue(koord2); |
1731 err.setCode(670); | 1837 err.setCode(670); |
1732 currentErrors.add(err);; | 1838 currentErrors.add(err);; |
1733 return; | 1839 return; |
1734 } | 1840 } |
1841 currentEOrt.put("P_KOORDINATEN_X", koord1); | |
1842 currentEOrt.put("P_KOORDINATEN_Y", koord2); | |
1843 currentEOrt.put("P_KOORDINATEN_ART_S", art); | |
1844 hasEKoordinaten = true; | |
1735 // TODO: Add to "entnahmeort" | 1845 // TODO: Add to "entnahmeort" |
1736 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1846 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1737 } | 1847 } |
1738 | 1848 |
1739 /** | 1849 /** |
1753 err.setValue(value); | 1863 err.setValue(value); |
1754 err.setCode(670); | 1864 err.setCode(670); |
1755 currentErrors.add(err);; | 1865 currentErrors.add(err);; |
1756 return; | 1866 return; |
1757 } | 1867 } |
1868 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1758 // TODO: Add to "entnahmeort" | 1869 // TODO: Add to "entnahmeort" |
1759 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1870 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1760 } | 1871 } |
1761 | 1872 |
1762 /** | 1873 /** |
1776 err.setValue(value); | 1887 err.setValue(value); |
1777 err.setCode(670); | 1888 err.setCode(670); |
1778 currentErrors.add(err);; | 1889 currentErrors.add(err);; |
1779 return; | 1890 return; |
1780 } | 1891 } |
1892 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1781 // TODO: Add to "entnahmeort" | 1893 // TODO: Add to "entnahmeort" |
1782 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1894 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1783 } | 1895 } |
1784 | 1896 |
1785 /** | 1897 /** |
1799 err.setValue(value); | 1911 err.setValue(value); |
1800 err.setCode(670); | 1912 err.setCode(670); |
1801 currentErrors.add(err);; | 1913 currentErrors.add(err);; |
1802 return; | 1914 return; |
1803 } | 1915 } |
1916 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1804 // TODO: Add to "entnahmeort" | 1917 // TODO: Add to "entnahmeort" |
1805 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1918 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1806 } | 1919 } |
1807 | 1920 |
1808 /** | 1921 /** |
1822 err.setValue(value); | 1935 err.setValue(value); |
1823 err.setCode(670); | 1936 err.setCode(670); |
1824 currentErrors.add(err);; | 1937 currentErrors.add(err);; |
1825 return; | 1938 return; |
1826 } | 1939 } |
1940 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1827 // TODO: Add to "entnahmeort" | 1941 // TODO: Add to "entnahmeort" |
1828 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1942 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1829 } | 1943 } |
1830 | 1944 |
1831 /** | 1945 /** |
1845 err.setValue(value); | 1959 err.setValue(value); |
1846 err.setCode(670); | 1960 err.setCode(670); |
1847 currentErrors.add(err);; | 1961 currentErrors.add(err);; |
1848 return; | 1962 return; |
1849 } | 1963 } |
1964 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1850 // TODO: Add to "entnahmeort" | 1965 // TODO: Add to "entnahmeort" |
1851 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1966 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1852 } | 1967 } |
1853 | 1968 |
1854 /** | 1969 /** |
1868 err.setValue(value); | 1983 err.setValue(value); |
1869 err.setCode(670); | 1984 err.setCode(670); |
1870 currentErrors.add(err);; | 1985 currentErrors.add(err);; |
1871 return; | 1986 return; |
1872 } | 1987 } |
1988 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1873 // TODO: Add to "entnahmeort" | 1989 // TODO: Add to "entnahmeort" |
1874 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 1990 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1875 } | 1991 } |
1876 | 1992 |
1877 /** | 1993 /** |
1891 err.setValue(value); | 2007 err.setValue(value); |
1892 err.setCode(670); | 2008 err.setCode(670); |
1893 currentErrors.add(err);; | 2009 currentErrors.add(err);; |
1894 return; | 2010 return; |
1895 } | 2011 } |
2012 currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); | |
1896 // TODO: Add to "entnahmeort" | 2013 // TODO: Add to "entnahmeort" |
1897 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); | 2014 //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); |
1898 } | 2015 } |
1899 | 2016 |
1900 /** | 2017 /** |