raimund@711: /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz raimund@711: * Software engineering by Intevation GmbH raimund@711: * raimund@711: * This file is Free Software under the GNU GPL (v>=3) raimund@711: * and comes with ABSOLUTELY NO WARRANTY! Check out raimund@711: * the documentation coming with IMIS-Labordaten-Application for details. raimund@711: */ raimund@542: package de.intevation.lada.validation.rules.probe; raimund@542: raimund@542: import de.intevation.lada.model.land.LProbe; raimund@542: import de.intevation.lada.validation.Violation; raimund@542: import de.intevation.lada.validation.annotation.ValidationRule; raimund@542: import de.intevation.lada.validation.rules.Rule; raimund@542: raimund@711: /** raimund@711: * Validation rule for probe. raimund@711: * Validates if the probe has a "umwelt bereich". raimund@711: * raimund@711: * @author Raimund Renkert raimund@711: */ raimund@542: @ValidationRule("Probe") raimund@542: public class HasUmwelt implements Rule { raimund@542: raimund@542: @Override raimund@542: public Violation execute(Object object) { raimund@542: LProbe probe = (LProbe)object; raimund@542: if (probe.getUmwId() == null || raimund@542: probe.getUmwId().equals("")) { raimund@542: Violation violation = new Violation(); raimund@569: violation.addWarning("umwId", 631); raimund@542: return violation; raimund@542: } raimund@542: return null; raimund@542: } raimund@542: }