changeset 618:2e26f06b6e4b

Added validation rule for probe.probeart.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 17 Apr 2015 13:24:55 +0200
parents 8086664d1629
children 427db9da89b9
files src/main/java/de/intevation/lada/validation/rules/probe/HasProbeart.java
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/validation/rules/probe/HasProbeart.java	Fri Apr 17 13:24:55 2015 +0200
@@ -0,0 +1,22 @@
+package de.intevation.lada.validation.rules.probe;
+
+import de.intevation.lada.model.land.LProbe;
+import de.intevation.lada.validation.Violation;
+import de.intevation.lada.validation.annotation.ValidationRule;
+import de.intevation.lada.validation.rules.Rule;
+
+@ValidationRule("Probe")
+public class HasProbeart implements Rule {
+
+    @Override
+    public Violation execute(Object object) {
+        LProbe probe = (LProbe)object;
+        if (probe.getProbenartId() == null ||
+            probe.getProbenartId().equals("")) {
+            Violation violation = new Violation();
+            violation.addError("probenartId", 631);
+            return violation;
+        }
+        return null;
+    }
+}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)