changeset 122:84e4f3aaf9ca

Added validator for LOrt.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 12 Jun 2013 16:11:13 +0200
parents 958e94029163
children 5f41ec50cc0a
files src/main/java/de/intevation/lada/validation/LOrtValidator.java
diffstat 1 files changed, 31 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/LOrtValidator.java	Wed Jun 12 16:11:13 2013 +0200
@@ -0,0 +1,31 @@
+package de.intevation.lada.validation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Named;
+
+import de.intevation.lada.model.LOrt;
+
+@ApplicationScoped
+@Named("lortvalidator")
+public class LOrtValidator
+implements Validator
+{
+
+    @Override
+    public Map<String, Integer> validate(Object object)
+    throws ValidationException {
+        Map<String, Integer> warnings = new HashMap<String, Integer>();
+        if (!(object instanceof LOrt)) {
+            Map<String, Integer> errors = new HashMap<String, Integer>();
+            errors.put("lort", 610);
+            throw new ValidationException(errors);
+        }
+
+        //TODO: more validation, see LSB: VI - Konsistenzregeln
+        return warnings;
+    }
+
+}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)