tom@1097: package de.intevation.lada.importer.laf; tom@1097: tom@1097: import java.util.ArrayList; tom@1097: import java.util.HashMap; tom@1097: import java.util.List; tom@1097: import java.util.Map; tom@1097: tom@1097: import org.antlr.v4.runtime.ParserRuleContext; tom@1097: import org.antlr.v4.runtime.tree.ErrorNode; tom@1097: import org.antlr.v4.runtime.tree.TerminalNode; tom@1097: tom@1097: import de.intevation.lada.importer.ReportItem; tom@1097: tom@1097: public class LafObjectListener extends LafBaseListener { tom@1097: tom@1097: LafRawData data; tom@1097: LafRawData.Probe currentProbe; tom@1097: LafRawData.Messung currentMessung; raimund@1146: Map currentUOrt; raimund@1146: Map currentEOrt; tom@1097: Map> errors; tom@1113: ArrayList currentErrors; tom@1097: raimund@1100: private boolean hasDatenbasis = false; raimund@1100: private boolean hasMessprogramm = false; raimund@1100: private boolean hasUmwelt = false; raimund@1100: private boolean hasZeitbasis = false; raimund@1100: private boolean hasUebertragungsformat = false; raimund@1100: private boolean hasVersion = false; raimund@1146: private boolean hasEHerkunfstland = false; raimund@1146: private boolean hasEGemeinde = false; raimund@1146: private boolean hasEKoordinaten = false; raimund@1146: private boolean hasUHerkunfstland = false; raimund@1146: private boolean hasUGemeinde = false; raimund@1146: private boolean hasUKoordinaten = false; raimund@1100: tom@1097: public LafObjectListener() { tom@1097: data = new LafRawData(); tom@1097: errors = new HashMap>(); tom@1097: currentErrors = new ArrayList(); raimund@1146: currentUOrt = new HashMap(); raimund@1256: currentEOrt = new HashMap(); tom@1097: } tom@1097: tom@1097: public LafRawData getData() { tom@1097: return data; tom@1097: } tom@1097: tom@1097: /** tom@1097: * @return the errors tom@1097: */ tom@1097: public Map> getErrors() { tom@1097: return errors; tom@1097: } tom@1097: tom@1097: /** raimund@1100: * @return the hasUebertragungsformat raimund@1100: */ raimund@1100: public boolean hasUebertragungsformat() { raimund@1100: return hasUebertragungsformat; raimund@1100: } raimund@1100: raimund@1100: /** raimund@1100: * @return the hasVersion raimund@1100: */ raimund@1100: public boolean hasVersion() { raimund@1100: return hasVersion; raimund@1100: } raimund@1100: raimund@1100: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbendatei(LafParser.ProbendateiContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void exitProbendatei(LafParser.ProbendateiContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterEnd(LafParser.EndContext ctx) { tom@1097: if (currentProbe != null) { tom@1097: data.addProbe(currentProbe); raimund@1100: if (!currentErrors.isEmpty()) { tom@1133: errors.put(currentProbe.getIdentifier(), tom@1133: (ArrayList)currentErrors.clone()); raimund@1100: } tom@1113: tom@1097: currentErrors.clear(); tom@1097: currentProbe = null; raimund@1100: hasDatenbasis = false; raimund@1100: hasMessprogramm = false; raimund@1100: hasUmwelt = false; raimund@1100: hasZeitbasis = false; tom@1097: } tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbe(LafParser.ProbeContext ctx) { tom@1097: if (currentMessung != null) { tom@1097: currentProbe.addMessung(currentMessung); tom@1097: currentMessung = null; tom@1097: } raimund@1146: if (currentUOrt != null && !currentUOrt.isEmpty()) { raimund@1146: currentProbe.addUrsprungsOrt(currentUOrt); raimund@1146: currentUOrt.clear(); raimund@1146: } raimund@1146: if (currentEOrt != null && !currentEOrt.isEmpty()) { raimund@1146: currentProbe.addEntnahmeOrt(currentEOrt); raimund@1146: currentEOrt.clear(); raimund@1146: } tom@1097: currentProbe = data.new Probe(); raimund@1256: hasEKoordinaten = false; raimund@1256: hasEGemeinde = false; raimund@1256: hasEHerkunfstland = false; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void exitProbe(LafParser.ProbeContext ctx) { tom@1097: data.addProbe(currentProbe); raimund@1163: if (currentMessung != null) { raimund@1163: currentProbe.addMessung(currentMessung); raimund@1163: currentMessung = null; raimund@1163: } raimund@1163: if (currentUOrt != null && !currentUOrt.isEmpty()) { raimund@1163: currentProbe.addUrsprungsOrt(currentUOrt); raimund@1163: currentUOrt.clear(); raimund@1163: } raimund@1163: if (currentEOrt != null && !currentEOrt.isEmpty()) { raimund@1163: currentProbe.addEntnahmeOrt(currentEOrt); raimund@1163: currentEOrt.clear(); raimund@1163: } raimund@1163: currentProbe = data.new Probe(); raimund@1100: if (!currentErrors.isEmpty()) { tom@1133: errors.put(currentProbe.getIdentifier(), tom@1133: (ArrayList)currentErrors.clone()); raimund@1100: } tom@1097: currentErrors.clear(); tom@1097: currentProbe = null; raimund@1256: hasEKoordinaten = false; raimund@1256: hasEGemeinde = false; raimund@1256: hasEHerkunfstland = false; raimund@1100: hasDatenbasis = false; raimund@1100: hasMessprogramm = false; raimund@1100: hasUmwelt = false; raimund@1100: hasZeitbasis = false; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterDb(LafParser.DbContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMp(LafParser.MpContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterUb(LafParser.UbContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterRei(LafParser.ReiContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterPh(LafParser.PhContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterPg(LafParser.PgContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterPk(LafParser.PkContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterZb(LafParser.ZbContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterPzb(LafParser.PzbContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterPkom(LafParser.PkomContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterSdm(LafParser.SdmContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterPnh(LafParser.PnhContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterUh(LafParser.UhContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void exitUh(LafParser.UhContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterUg(LafParser.UgContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterUk(LafParser.UkContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMessung(LafParser.MessungContext ctx) { tom@1097: if (currentMessung != null) { tom@1097: currentProbe.addMessung(currentMessung); tom@1097: } raimund@1146: if (currentUOrt != null && !currentUOrt.isEmpty()) { raimund@1146: currentProbe.addUrsprungsOrt(currentUOrt); raimund@1146: currentUOrt.clear(); raimund@1146: } raimund@1146: if (currentEOrt != null && !currentEOrt.isEmpty()) { raimund@1146: currentProbe.addEntnahmeOrt(currentEOrt); raimund@1146: currentEOrt.clear(); raimund@1146: } tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void exitMessung(LafParser.MessungContext ctx) { tom@1097: currentProbe.addMessung(currentMessung); tom@1097: currentMessung = null; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ raimund@1146: @Override public void enterUrsprungsort(LafParser.UrsprungsortContext ctx) { raimund@1146: if (currentMessung != null) { raimund@1146: currentProbe.addMessung(currentMessung); raimund@1146: currentMessung = data.new Messung(); raimund@1146: } raimund@1146: if (currentUOrt != null && !currentUOrt.isEmpty()) { raimund@1146: currentProbe.addUrsprungsOrt(currentUOrt); raimund@1146: } raimund@1146: if (currentEOrt != null && !currentEOrt.isEmpty()) { raimund@1146: currentProbe.addEntnahmeOrt(currentEOrt); raimund@1146: currentEOrt.clear(); raimund@1146: } raimund@1146: currentUOrt.clear(); raimund@1146: } raimund@1146: raimund@1146: /** raimund@1146: * {@inheritDoc} raimund@1146: * raimund@1146: *

The default implementation does nothing.

raimund@1146: */ raimund@1146: @Override public void exitUrsprungsort(LafParser.UrsprungsortContext ctx) { raimund@1146: } raimund@1146: raimund@1146: raimund@1146: /** raimund@1146: * {@inheritDoc} raimund@1146: * raimund@1146: *

The default implementation does nothing.

raimund@1146: */ tom@1097: @Override public void enterMm(LafParser.MmContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMw(LafParser.MwContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterPn(LafParser.PnContext ctx) { tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterUebertragungsformat(LafParser.UebertragungsformatContext ctx) { raimund@1100: hasUebertragungsformat = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterVersion(LafParser.VersionContext ctx) { raimund@1100: hasVersion = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterDatenbasis(LafParser.DatenbasisContext ctx) { raimund@1100: if (this.hasDatenbasis) { raimund@1100: return; raimund@1100: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: // Trim double qoutes. tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C6)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); raimund@1100: this.hasDatenbasis = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterDatenbasis_s(LafParser.Datenbasis_sContext ctx) { raimund@1100: if (this.hasDatenbasis) { raimund@1100: return; raimund@1100: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SI2)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); raimund@1100: this.hasDatenbasis = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterNetzkennung(LafParser.NetzkennungContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C2)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterErzeuger(LafParser.ErzeugerContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C2)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterStaat_der_messstelle_lang(LafParser.Staat_der_messstelle_langContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterStaat_der_messstelle_kurz(LafParser.Staat_der_messstelle_kurzContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C5)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterStaat_der_messstelle_s(LafParser.Staat_der_messstelle_sContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SI8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMessstelle(LafParser.MessstelleContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SC5)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesslabor(LafParser.MesslaborContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SC5)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbe_id(LafParser.Probe_idContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C16)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMessungs_id(LafParser.Messungs_idContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.I2)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProben_nr(LafParser.Proben_nrContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.I2)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterHauptprobennummer(LafParser.HauptprobennummerContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C20)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterNebenprobennummer(LafParser.NebenprobennummerContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMessprogramm_c(LafParser.Messprogramm_cContext ctx) { raimund@1100: if (this.hasMessprogramm) { raimund@1100: return; raimund@1100: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); raimund@1100: this.hasMessprogramm = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMessprogramm_s(LafParser.Messprogramm_sContext ctx) { raimund@1100: if (this.hasMessprogramm) { raimund@1100: return; raimund@1100: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SC1)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); raimund@1100: this.hasMessprogramm = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMessprogramm_land(LafParser.Messprogramm_landContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C3)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbenahmeinstitution(LafParser.ProbenahmeinstitutionContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C9)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbenart(LafParser.ProbenartContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C1)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterZeitbasis(LafParser.ZeitbasisContext ctx) { raimund@1100: if (this.hasZeitbasis) { raimund@1100: return; raimund@1100: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); raimund@1100: this.hasZeitbasis = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterZeitbasis_s(LafParser.Zeitbasis_sContext ctx) { raimund@1100: if (this.hasZeitbasis) { raimund@1100: return; raimund@1100: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SI1)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); raimund@1100: this.hasZeitbasis = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterSoll_datum_uhrzeit_a(LafParser.Soll_datum_uhrzeit_aContext ctx) { raimund@1111: if (ctx.getChildCount() < 4) { raimund@1111: return; raimund@1111: } tom@1097: String date = ctx.getChild(1).toString(); tom@1097: date = date.replaceAll("\"", ""); tom@1097: if (!date.matches(LafDataTypes.D8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(date); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String time = ctx.getChild(3).toString(); tom@1097: time = time.replaceAll("\"", ""); tom@1097: if (!time.matches(LafDataTypes.T4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(time); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), date + ' ' + time); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterSoll_datum_uhrzeit_e(LafParser.Soll_datum_uhrzeit_eContext ctx) { raimund@1111: if (ctx.getChildCount() < 4) { raimund@1111: return; raimund@1111: } tom@1097: String date = ctx.getChild(1).toString(); tom@1097: date = date.replaceAll("\"", ""); tom@1097: if (!date.matches(LafDataTypes.D8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(date); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String time = ctx.getChild(3).toString(); tom@1097: time = time.replaceAll("\"", ""); tom@1097: if (!time.matches(LafDataTypes.T4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(time); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), date + ' ' + time); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterUrsprungs_datum_uhrzeit(LafParser.Ursprungs_datum_uhrzeitContext ctx) { raimund@1111: if (ctx.getChildCount() < 4) { raimund@1111: return; raimund@1111: } tom@1097: String date = ctx.getChild(1).toString(); tom@1097: date = date.replaceAll("\"", ""); tom@1097: if (!date.matches(LafDataTypes.D8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(date); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String time = ctx.getChild(3).toString(); tom@1097: time = time.replaceAll("\"", ""); tom@1097: if (!time.matches(LafDataTypes.T4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(time); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), date + ' ' + time); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbenahme_datum_uhrzeit_a(LafParser.Probenahme_datum_uhrzeit_aContext ctx) { raimund@1111: if (ctx.getChildCount() < 4) { raimund@1111: return; raimund@1111: } tom@1097: String date = ctx.getChild(1).toString(); tom@1097: date = date.replaceAll("\"", ""); tom@1097: if (!date.matches(LafDataTypes.D8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(date); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String time = ctx.getChild(3).toString(); tom@1097: time = time.replaceAll("\"", ""); tom@1097: if (!time.matches(LafDataTypes.T4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(time); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), date + ' ' + time); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbenahme_datum_uhrzeit_e(LafParser.Probenahme_datum_uhrzeit_eContext ctx) { raimund@1111: if (ctx.getChildCount() < 4) { raimund@1111: return; raimund@1111: } tom@1097: String date = ctx.getChild(1).toString(); tom@1097: date = date.replaceAll("\"", ""); tom@1097: if (!date.matches(LafDataTypes.D8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(date); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String time = ctx.getChild(3).toString(); tom@1097: time = time.replaceAll("\"", ""); tom@1097: if (!time.matches(LafDataTypes.T4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(time); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), date + ' ' + time); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterUmweltbereich_c(LafParser.Umweltbereich_cContext ctx) { raimund@1100: if (this.hasUmwelt) { raimund@1100: return; raimund@1100: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); raimund@1100: this.hasUmwelt = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterUmweltbereich_s(LafParser.Umweltbereich_sContext ctx) { raimund@1100: if (this.hasUmwelt) { raimund@1100: return; raimund@1100: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); raimund@1335: if (!value.matches(LafDataTypes.C3)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); raimund@1100: this.hasUmwelt = true; tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterDeskriptoren(LafParser.DeskriptorenContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C26)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterRei_programmpunkt(LafParser.Rei_programmpunktContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C10)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterRei_programmpunktgruppe(LafParser.Rei_programmpunktgruppeContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C21)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterReferenz_datum_uhrzeit(LafParser.Referenz_datum_uhrzeitContext ctx) { raimund@1111: if (ctx.getChildCount() < 4) { raimund@1111: return; raimund@1111: } tom@1097: String date = ctx.getChild(1).toString(); tom@1097: date = date.replaceAll("\"", ""); tom@1097: if (!date.matches(LafDataTypes.D8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(date); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String time = ctx.getChild(3).toString(); tom@1097: time = time.replaceAll("\"", ""); tom@1097: if (!time.matches(LafDataTypes.T4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(time); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), date + ' ' + time); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterTestdaten(LafParser.TestdatenContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.BOOL)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterSzenario(LafParser.SzenarioContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C20)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterSek_datenbasis(LafParser.Sek_datenbasisContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterSek_datenbasis_s(LafParser.Sek_datenbasis_sContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SI2)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_herkunftsland_lang(LafParser.U_herkunftsland_langContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasUHerkunfstland = true; tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_herkunftsland_kurz(LafParser.U_herkunftsland_kurzContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C5)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasUHerkunfstland = true; tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_herkunftsland_s(LafParser.U_herkunftsland_sContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SI8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasUHerkunfstland = true; tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_gemeindeschluessel(LafParser.U_gemeindeschluesselContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.I8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasUGemeinde= true; tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_gemeindename(LafParser.U_gemeindenameContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasUGemeinde= true; tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_orts_zusatzkennzahl(LafParser.U_orts_zusatzkennzahlContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.I3)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_koordinaten(LafParser.U_koordinatenContext ctx) { raimund@1111: if (ctx.getChildCount() < 6) { raimund@1111: return; raimund@1111: } tom@1097: String art = ctx.getChild(1).toString(); tom@1097: art = art.replaceAll("\"", ""); tom@1097: if (!art.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(art); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String koord1 = ctx.getChild(3).toString(); tom@1097: koord1 = koord1.replaceAll("\"", ""); tom@1097: if (!koord1.matches(LafDataTypes.C22)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(koord1); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String koord2 = ctx.getChild(5).toString(); tom@1097: koord2 = koord2.replaceAll("\"", ""); tom@1097: if (!koord2.matches(LafDataTypes.C22)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(koord2); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put("U_KOORDINATEN_X", koord1); raimund@1146: currentUOrt.put("U_KOORDINATEN_Y", koord2); raimund@1146: currentUOrt.put("U_KOORDINATEN_ART", art); raimund@1146: hasUKoordinaten = true; tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_koordinaten_s(LafParser.U_koordinaten_sContext ctx) { raimund@1146: System.out.println("koordinaten"); raimund@1111: if (ctx.getChildCount() < 6) { raimund@1111: return; raimund@1111: } tom@1097: String art = ctx.getChild(1).toString(); tom@1097: art = art.replaceAll("\"", ""); tom@1097: if (!art.matches(LafDataTypes.SI2)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(art); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String koord1 = ctx.getChild(3).toString(); tom@1097: koord1 = koord1.replaceAll("\"", ""); tom@1097: if (!koord1.matches(LafDataTypes.C22)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(koord1); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String koord2 = ctx.getChild(5).toString(); tom@1097: koord2 = koord2.replaceAll("\"", ""); tom@1097: if (!koord2.matches(LafDataTypes.C22)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(koord2); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: System.out.println("add"); raimund@1146: currentUOrt.put("U_KOORDINATEN_X", koord1); raimund@1146: currentUOrt.put("U_KOORDINATEN_Y", koord2); raimund@1146: currentUOrt.put("U_KOORDINATEN_ART_S", art); raimund@1146: hasUKoordinaten = true; tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_orts_zusatzcode(LafParser.U_orts_zusatzcodeContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1113: currentErrors.add(err); tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_orts_zusatztext(LafParser.U_orts_zusatztextContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.MC50)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterU_nuts_code(LafParser.U_nuts_codeContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); raimund@1100: if (!value.matches(LafDataTypes.C10)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentUOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "ursprungsort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_herkunftsland_lang(LafParser.P_herkunftsland_langContext ctx) { raimund@1146: if (hasEHerkunfstland) { raimund@1146: return; raimund@1146: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasEHerkunfstland = true; tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_herkunftsland_kurz(LafParser.P_herkunftsland_kurzContext ctx) { raimund@1146: if (hasEHerkunfstland) { raimund@1146: return; raimund@1146: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C5)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasEHerkunfstland = true; tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_herkunftsland_s(LafParser.P_herkunftsland_sContext ctx) { raimund@1146: if (hasEHerkunfstland) { raimund@1146: return; raimund@1146: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SI8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasEHerkunfstland = true; tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_gemeindeschluessel(LafParser.P_gemeindeschluesselContext ctx) { raimund@1146: if (hasEGemeinde) { raimund@1146: return; raimund@1146: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.I8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasEGemeinde = true; tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_gemeindename(LafParser.P_gemeindenameContext ctx) { raimund@1146: if (hasEGemeinde) { raimund@1146: return; raimund@1146: } raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); raimund@1146: hasEGemeinde = true; tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_orts_zusatzkennzahl(LafParser.P_orts_zusatzkennzahlContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.I3)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_koordinaten(LafParser.P_koordinatenContext ctx) { raimund@1146: if (hasEKoordinaten) { raimund@1146: return; raimund@1146: } raimund@1111: if (ctx.getChildCount() < 6) { raimund@1111: return; raimund@1111: } tom@1097: String art = ctx.getChild(1).toString(); tom@1097: art = art.replaceAll("\"", ""); tom@1097: if (!art.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(art); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String koord1 = ctx.getChild(3).toString(); tom@1097: koord1 = koord1.replaceAll("\"", ""); tom@1097: if (!koord1.matches(LafDataTypes.C22)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(koord1); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String koord2 = ctx.getChild(5).toString(); tom@1097: koord2 = koord2.replaceAll("\"", ""); tom@1097: if (!koord2.matches(LafDataTypes.C22)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(koord2); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put("P_KOORDINATEN_X", koord1); raimund@1146: currentEOrt.put("P_KOORDINATEN_Y", koord2); raimund@1146: currentEOrt.put("P_KOORDINATEN_ART", art); raimund@1146: hasEKoordinaten = true; tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_koordinaten_s(LafParser.P_koordinaten_sContext ctx) { raimund@1146: if (hasEKoordinaten) { raimund@1146: return; raimund@1146: } raimund@1111: if (ctx.getChildCount() < 6) { raimund@1111: return; raimund@1111: } tom@1097: String art = ctx.getChild(1).toString(); tom@1097: art = art.replaceAll("\"", ""); tom@1097: if (!art.matches(LafDataTypes.SI2)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(art); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String koord1 = ctx.getChild(3).toString(); tom@1097: koord1 = koord1.replaceAll("\"", ""); tom@1097: if (!koord1.matches(LafDataTypes.C22)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(koord1); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String koord2 = ctx.getChild(5).toString(); tom@1097: koord2 = koord2.replaceAll("\"", ""); tom@1097: if (!koord2.matches(LafDataTypes.C22)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(koord2); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put("P_KOORDINATEN_X", koord1); raimund@1146: currentEOrt.put("P_KOORDINATEN_Y", koord2); raimund@1146: currentEOrt.put("P_KOORDINATEN_ART_S", art); raimund@1146: hasEKoordinaten = true; tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_orts_zusatzcode(LafParser.P_orts_zusatzcodeContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_orts_zusatztext(LafParser.P_orts_zusatztextContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.MC50)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_nuts_code(LafParser.P_nuts_codeContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); raimund@1100: if (!value.matches(LafDataTypes.C10)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_site_id(LafParser.P_site_idContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_site_name(LafParser.P_site_nameContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_hoehe_nn(LafParser.P_hoehe_nnContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.F10)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterP_hoehe_land(LafParser.P_hoehe_landContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.F10)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1146: currentEOrt.put(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: // TODO: Add to "entnahmeort" tom@1097: //currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMehrzweckfeld(LafParser.MehrzweckfeldContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.MC300)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: currentProbe.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMess_datum_uhrzeit(LafParser.Mess_datum_uhrzeitContext ctx) { raimund@1111: if (ctx.getChildCount() < 4) { raimund@1111: return; raimund@1111: } tom@1097: String date = ctx.getChild(1).toString(); tom@1097: date = date.replaceAll("\"", ""); tom@1097: if (!date.matches(LafDataTypes.D8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(date); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String time = ctx.getChild(3).toString(); tom@1097: time = time.replaceAll("\"", ""); tom@1097: if (!time.matches(LafDataTypes.T4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(time); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addAttribute(ctx.getChild(0).toString().toUpperCase(), date + ' ' + time); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesszeit_sekunden(LafParser.Messzeit_sekundenContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.I8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMessmethode_c(LafParser.Messmethode_cContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMessmethode_s(LafParser.Messmethode_sContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.SC2)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterBearbeitungsstatus(LafParser.BearbeitungsstatusContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.C4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterPep_flag(LafParser.Pep_flagContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.BOOL)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterErfassung_abgeschlossen(LafParser.Erfassung_abgeschlossenContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String value = ctx.getChild(1).toString(); tom@1097: value = value.replaceAll("\"", ""); tom@1097: if (!value.matches(LafDataTypes.BOOL)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(value); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addAttribute(ctx.getChild(0).toString().toUpperCase(), value); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbenzusatzbeschreibung(LafParser.ProbenzusatzbeschreibungContext ctx) { tom@1097: // c7* f12 c9 f9 raimund@1111: if (ctx.getChildCount() < 8) { raimund@1111: return; raimund@1111: } tom@1097: String groesse = ctx.getChild(1).toString(); tom@1097: groesse = groesse.replaceAll("\"", ""); tom@1097: if (!groesse.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(groesse); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String wert = ctx.getChild(3).toString(); tom@1097: wert = wert.replaceAll("\"", ""); tom@1097: if (!wert.matches(LafDataTypes.F12)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(wert); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String einheit = ctx.getChild(5).toString(); tom@1097: einheit = einheit.replaceAll("\"", ""); tom@1097: if (!einheit.matches(LafDataTypes.C9)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(einheit); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String fehler = ctx.getChild(7).toString(); tom@1097: fehler = fehler.replaceAll("\"", ""); tom@1097: if (!fehler.matches(LafDataTypes.F9)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(fehler); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: Map zusatzwert = new HashMap(); tom@1097: zusatzwert.put("PZS", groesse); tom@1097: zusatzwert.put("MESSWERT_PZS", wert); tom@1097: zusatzwert.put("EINHEIT", einheit); tom@1097: zusatzwert.put("MESSFEHLER", fehler); tom@1097: currentProbe.addZusatzwert(zusatzwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterPzb_s(LafParser.Pzb_sContext ctx) { tom@1097: // sc8* f12 si3 f9 raimund@1111: if (ctx.getChildCount() < 8) { raimund@1111: return; raimund@1111: } tom@1097: String groesse = ctx.getChild(1).toString(); tom@1097: groesse = groesse.replaceAll("\"", ""); tom@1097: if (!groesse.matches(LafDataTypes.SC8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(groesse); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String wert = ctx.getChild(3).toString(); tom@1097: wert = wert.replaceAll("\"", ""); tom@1097: if (!wert.matches(LafDataTypes.F12)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(wert); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String einheit = ctx.getChild(5).toString(); tom@1097: einheit = einheit.replaceAll("\"", ""); tom@1097: if (!einheit.matches(LafDataTypes.SI3)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(einheit); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String fehler = ctx.getChild(7).toString(); tom@1097: fehler = fehler.replaceAll("\"", ""); tom@1097: if (!fehler.matches(LafDataTypes.F9)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(fehler); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: Map zusatzwert = new HashMap(); tom@1097: zusatzwert.put("PZS_ID", groesse); tom@1097: zusatzwert.put("MESSWERT_PZS", wert); tom@1097: zusatzwert.put("EINHEIT_ID", einheit); tom@1097: zusatzwert.put("MESSFEHLER", fehler); tom@1097: currentProbe.addZusatzwert(zusatzwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesswert(LafParser.MesswertContext ctx) { tom@1097: // c50* f12 c9 f9** tom@1097: List children = new ArrayList(); tom@1097: for (int i = 0; i < ctx.getChildCount(); i++) { tom@1097: if (!ctx.getChild(i).toString().startsWith(" ")) { tom@1097: children.add(ctx.getChild(i).toString()); tom@1097: } tom@1097: } raimund@1111: if (children.size() < 5) { raimund@1111: return; raimund@1111: } tom@1097: String groesse = children.get(1); tom@1097: groesse = groesse.replaceAll("\"", ""); tom@1097: if (!groesse.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(groesse); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String wert = children.get(2); tom@1097: wert = wert.replaceAll("\"", ""); tom@1097: if (!wert.matches(LafDataTypes.F12)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(wert); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String einheit = children.get(3); tom@1097: einheit = einheit.replaceAll("\"", ""); tom@1097: if (!einheit.matches(LafDataTypes.C9)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(einheit); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String fehler = null; raimund@1100: if (ctx.getChildCount() >= 5) { tom@1097: fehler = children.get(4); tom@1097: fehler = fehler.replaceAll("\"", ""); tom@1097: if (!fehler.matches(LafDataTypes.F9)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(fehler); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: } tom@1097: Map messwert = new HashMap(); tom@1097: messwert.put("MESSGROESSE", groesse); tom@1097: messwert.put("MESSWERT", wert); tom@1097: messwert.put("MEH", einheit); tom@1097: messwert.put("MESSFEHLER", fehler); tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addMesswert(messwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesswert_s(LafParser.Messwert_sContext ctx) { tom@1097: // si8 f12 si3 f9** tom@1097: List children = new ArrayList(); tom@1097: for (int i = 0; i < ctx.getChildCount(); i++) { tom@1097: if (!ctx.getChild(i).toString().startsWith(" ")) { tom@1097: children.add(ctx.getChild(i).toString()); tom@1097: } tom@1097: } raimund@1111: if (children.size() < 5) { raimund@1111: return; raimund@1111: } tom@1097: String groesse = children.get(1); tom@1097: groesse = groesse.replaceAll("\"", ""); tom@1097: if (!groesse.matches(LafDataTypes.SI8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(groesse); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String wert = children.get(2); tom@1097: wert = wert.replaceAll("\"", ""); tom@1097: if (!wert.matches(LafDataTypes.F12)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(wert); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String einheit = children.get(3); tom@1097: einheit = einheit.replaceAll("\"", ""); tom@1097: if (!einheit.matches(LafDataTypes.SI3)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(einheit); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1111: String fehler = children.get(4); raimund@1111: fehler = fehler.replaceAll("\"", ""); raimund@1111: if (!fehler.matches(LafDataTypes.F9)) { raimund@1111: ReportItem err = new ReportItem(); raimund@1111: err.setKey(ctx.getChild(0).toString()); raimund@1111: err.setValue(fehler); raimund@1111: err.setCode(670); raimund@1111: currentErrors.add(err);; raimund@1111: return; tom@1097: } tom@1097: Map messwert = new HashMap(); tom@1097: messwert.put("MESSGROESSE_ID", groesse); tom@1097: messwert.put("MESSWERT", wert); tom@1097: messwert.put("MEH_ID", einheit); tom@1097: messwert.put("MESSFEHLER", fehler); tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addMesswert(messwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesswert_i(LafParser.Messwert_iContext ctx) { tom@1097: // C50* f12 c9 f9** f9** f9** c50* tom@1097: List children = new ArrayList(); tom@1097: for (int i = 0; i < ctx.getChildCount(); i++) { tom@1097: if (!ctx.getChild(i).toString().startsWith(" ")) { tom@1097: children.add(ctx.getChild(i).toString()); tom@1097: } tom@1097: } raimund@1111: if (children.size() < 8) { raimund@1111: return; raimund@1111: } tom@1097: String groesse = children.get(1); tom@1097: groesse = groesse.replaceAll("\"", ""); tom@1097: if (!groesse.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(groesse); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String wert = children.get(2); tom@1097: wert = wert.replaceAll("\"", ""); tom@1097: if (!wert.matches(LafDataTypes.F12)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(wert); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String einheit = children.get(3); tom@1097: einheit = einheit.replaceAll("\"", ""); tom@1097: if (!einheit.matches(LafDataTypes.C9)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(einheit); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } raimund@1111: String fehler = children.get(4); raimund@1111: fehler = fehler.replaceAll("\"", ""); raimund@1111: if (!fehler.matches(LafDataTypes.F9)) { raimund@1111: ReportItem err = new ReportItem(); raimund@1111: err.setKey(ctx.getChild(0).toString()); raimund@1111: err.setValue(fehler); raimund@1111: err.setCode(670); raimund@1111: currentErrors.add(err);; raimund@1111: return; tom@1097: } tom@1097: // TODO: handle all values tom@1097: Map messwert = new HashMap(); tom@1097: messwert.put("MESSGROESSE", groesse); tom@1097: messwert.put("MESSWERT", wert); tom@1097: messwert.put("MEH", einheit); tom@1097: messwert.put("MESSFEHLER", fehler); tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addMesswert(messwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesswert_g(LafParser.Messwert_gContext ctx) { tom@1097: // C50* f12 c9 f9** f9** f9** c1 tom@1097: List children = new ArrayList(); tom@1097: for (int i = 0; i < ctx.getChildCount(); i++) { tom@1097: if (!ctx.getChild(i).toString().startsWith(" ")) { tom@1097: children.add(ctx.getChild(i).toString()); tom@1097: } tom@1097: } raimund@1111: if (children.size() < 8) { raimund@1111: return; raimund@1111: } tom@1097: String groesse = children.get(1); tom@1097: groesse = groesse.replaceAll("\"", ""); tom@1097: if (!groesse.matches(LafDataTypes.C_STAR)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(groesse); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String wert = children.get(2); tom@1097: wert = wert.replaceAll("\"", ""); tom@1097: if (!wert.matches(LafDataTypes.F12)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(wert); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String einheit = children.get(3); tom@1097: einheit = einheit.replaceAll("\"", ""); tom@1097: if (!einheit.matches(LafDataTypes.C9)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(einheit); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String fehler = null; tom@1097: if (ctx.getChildCount() >= 8) { tom@1097: fehler = children.get(4); tom@1097: fehler = fehler.replaceAll("\"", ""); tom@1097: if (!fehler.matches(LafDataTypes.F9)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(fehler); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: } tom@1097: // TODO: handle all values tom@1097: Map messwert = new HashMap(); tom@1097: messwert.put("MESSGROESSE", groesse); tom@1097: messwert.put("MESSWERT", wert); tom@1097: messwert.put("MEH", einheit); tom@1097: messwert.put("MESSFEHLER", fehler); tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addMesswert(messwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesswert_nwg(LafParser.Messwert_nwgContext ctx) { tom@1097: // C50* f12 c9 f9** f12 raimund@1100: List children = new ArrayList(); raimund@1100: for (int i = 0; i < ctx.getChildCount(); i++) { raimund@1100: if (!ctx.getChild(i).toString().startsWith(" ")) { raimund@1100: children.add(ctx.getChild(i).toString()); raimund@1100: } raimund@1100: } raimund@1111: if (children.size() < 6) { raimund@1111: return; raimund@1111: } raimund@1100: String groesse = children.get(1); raimund@1100: groesse = groesse.replaceAll("\"", ""); raimund@1100: if (!groesse.matches(LafDataTypes.C_STAR)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(groesse); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String wert = children.get(2); raimund@1100: wert = wert.replaceAll("\"", ""); raimund@1100: if (!wert.matches(LafDataTypes.F12)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(wert); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String einheit = children.get(3); raimund@1100: einheit = einheit.replaceAll("\"", ""); raimund@1100: if (!einheit.matches(LafDataTypes.C9)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(einheit); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String fehler = children.get(4); raimund@1100: fehler = fehler.replaceAll("\"", ""); raimund@1100: if (!fehler.matches(LafDataTypes.F9)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(fehler); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String nwg = children.get(5); raimund@1100: nwg = nwg.replaceAll("\"", ""); raimund@1100: if (!nwg.matches(LafDataTypes.F12)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(nwg); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: Map messwert = new HashMap(); raimund@1100: messwert.put("MESSGROESSE", groesse); raimund@1100: messwert.put("MESSWERT", wert); raimund@1100: messwert.put("MEH", einheit); raimund@1100: messwert.put("MESSFEHLER", fehler); raimund@1100: messwert.put("NWG", nwg); raimund@1100: if (currentMessung == null) { raimund@1100: currentMessung = data.new Messung(); raimund@1100: } raimund@1100: currentMessung.addMesswert(messwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesswert_nwg_s(LafParser.Messwert_nwg_sContext ctx) { raimund@1100: List children = new ArrayList(); raimund@1100: for (int i = 0; i < ctx.getChildCount(); i++) { raimund@1100: if (!ctx.getChild(i).toString().startsWith(" ")) { raimund@1100: children.add(ctx.getChild(i).toString()); raimund@1100: } raimund@1100: } raimund@1111: if (children.size() < 6) { raimund@1111: return; raimund@1111: } raimund@1100: String groesse = children.get(1); raimund@1100: groesse = groesse.replaceAll("\"", ""); raimund@1100: if (!groesse.matches(LafDataTypes.SI8)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(groesse); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String wert = children.get(2); raimund@1100: wert = wert.replaceAll("\"", ""); raimund@1100: if (!wert.matches(LafDataTypes.F12)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(wert); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String einheit = children.get(3); raimund@1100: einheit = einheit.replaceAll("\"", ""); raimund@1100: if (!einheit.matches(LafDataTypes.SI3)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(einheit); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String fehler = children.get(4); raimund@1100: fehler = fehler.replaceAll("\"", ""); raimund@1100: if (!fehler.matches(LafDataTypes.F9)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(fehler); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String nwg = children.get(5); raimund@1100: nwg = nwg.replaceAll("\"", ""); raimund@1100: if (!nwg.matches(LafDataTypes.F12)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(nwg); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: // TODO: handle all values raimund@1100: Map messwert = new HashMap(); raimund@1100: messwert.put("MESSGROESSE_ID", groesse); raimund@1100: messwert.put("MESSWERT", wert); raimund@1100: messwert.put("MEH_ID", einheit); raimund@1100: messwert.put("MESSFEHLER", fehler); raimund@1100: messwert.put("NWG", nwg); raimund@1100: if (currentMessung == null) { raimund@1100: currentMessung = data.new Messung(); raimund@1100: } raimund@1100: currentMessung.addMesswert(messwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesswert_nwg_i(LafParser.Messwert_nwg_iContext ctx) { raimund@1100: List children = new ArrayList(); raimund@1100: for (int i = 0; i < ctx.getChildCount(); i++) { raimund@1100: if (!ctx.getChild(i).toString().startsWith(" ")) { raimund@1100: children.add(ctx.getChild(i).toString()); raimund@1100: } raimund@1100: } raimund@1111: if (children.size() < 8) { raimund@1111: return; raimund@1111: } raimund@1100: String groesse = children.get(1); raimund@1100: groesse = groesse.replaceAll("\"", ""); raimund@1100: if (!groesse.matches(LafDataTypes.C_STAR)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(groesse); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String wert = children.get(2); raimund@1100: wert = wert.replaceAll("\"", ""); raimund@1100: if (!wert.matches(LafDataTypes.F12)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(wert); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String einheit = children.get(3); raimund@1100: einheit = einheit.replaceAll("\"", ""); raimund@1100: if (!einheit.matches(LafDataTypes.C9)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(einheit); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String fehler = children.get(4); raimund@1100: fehler = fehler.replaceAll("\"", ""); raimund@1100: if (!fehler.matches(LafDataTypes.F9)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(fehler); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String nwg = children.get(5); raimund@1100: nwg = nwg.replaceAll("\"", ""); raimund@1100: if (!nwg.matches(LafDataTypes.F12)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(nwg); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: // TODO: handle all values raimund@1100: Map messwert = new HashMap(); raimund@1100: messwert.put("MESSGROESSE", groesse); raimund@1100: messwert.put("MESSWERT", wert); raimund@1100: messwert.put("MEH", einheit); raimund@1100: messwert.put("MESSFEHLER", fehler); raimund@1100: messwert.put("NWG", nwg); raimund@1100: if (currentMessung == null) { raimund@1100: currentMessung = data.new Messung(); raimund@1100: } raimund@1100: currentMessung.addMesswert(messwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterMesswert_nwg_g(LafParser.Messwert_nwg_gContext ctx) { tom@1097: // TODO raimund@1100: List children = new ArrayList(); raimund@1100: for (int i = 0; i < ctx.getChildCount(); i++) { raimund@1100: if (!ctx.getChild(i).toString().startsWith(" ")) { raimund@1100: children.add(ctx.getChild(i).toString()); raimund@1100: } raimund@1100: } raimund@1111: if (children.size() < 8) { raimund@1111: return; raimund@1111: } raimund@1100: String groesse = children.get(1); raimund@1100: groesse = groesse.replaceAll("\"", ""); raimund@1100: if (!groesse.matches(LafDataTypes.C_STAR)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(groesse); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String wert = children.get(2); raimund@1100: wert = wert.replaceAll("\"", ""); raimund@1100: if (!wert.matches(LafDataTypes.F12)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(wert); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String einheit = children.get(3); raimund@1100: einheit = einheit.replaceAll("\"", ""); raimund@1100: if (!einheit.matches(LafDataTypes.C9)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(einheit); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String fehler = children.get(4); raimund@1100: fehler = fehler.replaceAll("\"", ""); raimund@1100: if (!fehler.matches(LafDataTypes.F9)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(fehler); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String nwg = children.get(5); raimund@1100: nwg = nwg.replaceAll("\"", ""); raimund@1100: if (!nwg.matches(LafDataTypes.F12)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(nwg); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: String gw = children.get(8); raimund@1100: gw = gw.replaceAll("\"", ""); raimund@1100: if (!gw.matches(LafDataTypes.F12)) { raimund@1100: ReportItem err = new ReportItem(); raimund@1100: err.setKey(ctx.getChild(0).toString()); raimund@1100: err.setValue(gw); raimund@1100: err.setCode(670); raimund@1100: currentErrors.add(err);; raimund@1100: return; raimund@1100: } raimund@1100: // TODO: handle all values raimund@1100: Map messwert = new HashMap(); raimund@1100: messwert.put("MESSGROESSE", groesse); raimund@1100: messwert.put("MESSWERT", wert); raimund@1100: messwert.put("MEH", einheit); raimund@1100: messwert.put("MESSFEHLER", fehler); raimund@1100: messwert.put("NWG", nwg); raimund@1100: messwert.put("GRENZWERT", gw); raimund@1100: if (currentMessung == null) { raimund@1100: currentMessung = data.new Messung(); raimund@1100: } raimund@1100: currentMessung.addMesswert(messwert); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterKommentar(LafParser.KommentarContext ctx) { tom@1097: // c5 d8 t4 mc300 raimund@1111: if (ctx.getChildCount() < 8) { raimund@1111: return; raimund@1111: } tom@1097: String mst = ctx.getChild(1).toString(); tom@1097: mst = mst.replaceAll("\"", ""); tom@1097: if (!mst.matches(LafDataTypes.C5)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(mst); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String date = ctx.getChild(3).toString(); tom@1097: date = date.replaceAll("\"", ""); tom@1097: if (!date.matches(LafDataTypes.D8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(date); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String time = ctx.getChild(5).toString(); tom@1097: time = time.replaceAll("\"", ""); tom@1097: if (!time.matches(LafDataTypes.T4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(time); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String text = ctx.getChild(7).toString(); tom@1097: text = text.replaceAll("\"", ""); tom@1097: if (!text.matches(LafDataTypes.MC300)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(text); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: Map kommentar = new HashMap(); tom@1097: kommentar.put("MST_ID", mst); tom@1097: kommentar.put("DATE", date); tom@1097: kommentar.put("TIME", time); tom@1097: kommentar.put("TEXT", text); tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addKommentar(kommentar); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterKommentar_t(LafParser.Kommentar_tContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String text = ctx.getChild(1).toString(); tom@1097: text = text.replaceAll("\"", ""); tom@1097: if (!text.matches(LafDataTypes.MC300)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(text); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: Map kommentar = new HashMap(); tom@1097: kommentar.put("TEXT", text); tom@1097: if (currentMessung == null) { tom@1097: currentMessung = data.new Messung(); tom@1097: } tom@1097: currentMessung.addKommentar(kommentar); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbenkommentar(LafParser.ProbenkommentarContext ctx) { tom@1097: // c5 d8 t4 mc300 raimund@1111: if (ctx.getChildCount() < 8) { raimund@1111: return; raimund@1111: } tom@1097: String mst = ctx.getChild(1).toString(); tom@1097: mst = mst.replaceAll("\"", ""); tom@1097: if (!mst.matches(LafDataTypes.C5)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(mst); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String date = ctx.getChild(3).toString(); tom@1097: date = date.replaceAll("\"", ""); tom@1097: if (!date.matches(LafDataTypes.D8)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(date); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String time = ctx.getChild(5).toString(); tom@1097: time = time.replaceAll("\"", ""); tom@1097: if (!time.matches(LafDataTypes.T4)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(time); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: String text = ctx.getChild(7).toString(); tom@1097: text = text.replaceAll("\"", ""); tom@1097: if (!text.matches(LafDataTypes.MC300)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(text); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: Map kommentar = new HashMap(); tom@1097: kommentar.put("MST_ID", mst); tom@1097: kommentar.put("DATE", date); tom@1097: kommentar.put("TIME", time); tom@1097: kommentar.put("TEXT", text); tom@1097: currentProbe.addKommentar(kommentar); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterProbenkommentar_t(LafParser.Probenkommentar_tContext ctx) { raimund@1111: if (ctx.getChildCount() < 2) { raimund@1111: return; raimund@1111: } tom@1097: String text = ctx.getChild(1).toString(); tom@1097: text = text.replaceAll("\"", ""); tom@1097: if (!text.matches(LafDataTypes.MC300)) { tom@1097: ReportItem err = new ReportItem(); tom@1097: err.setKey(ctx.getChild(0).toString()); tom@1097: err.setValue(text); tom@1097: err.setCode(670); tom@1097: currentErrors.add(err);; tom@1097: return; tom@1097: } tom@1097: Map kommentar = new HashMap(); tom@1097: kommentar.put("TEXT", text); tom@1097: currentProbe.addKommentar(kommentar); tom@1097: } tom@1097: tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void enterEveryRule(ParserRuleContext ctx) { tom@1097: } tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void exitEveryRule(ParserRuleContext ctx) { tom@1097: } tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void visitTerminal(TerminalNode node) { tom@1097: } tom@1097: /** tom@1097: * {@inheritDoc} tom@1097: * tom@1097: *

The default implementation does nothing.

tom@1097: */ tom@1097: @Override public void visitErrorNode(ErrorNode node) { tom@1097: } tom@1097: }