changeset 63:7dc8a1579e39

New validator interface and validation exception.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 31 May 2013 13:59:58 +0200
parents 0b3f58cbbd75
children 132eca870434
files src/main/java/de/intevation/lada/validation/ValidationException.java src/main/java/de/intevation/lada/validation/Validator.java
diffstat 2 files changed, 32 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/ValidationException.java	Fri May 31 13:59:58 2013 +0200
@@ -0,0 +1,22 @@
+package de.intevation.lada.validation;
+
+import java.util.Map;
+
+
+public class ValidationException
+extends Exception
+{
+    private Map<String, Integer> errors;
+
+    @SuppressWarnings("unused")
+    private ValidationException() {
+    }
+
+    public ValidationException(Map<String, Integer> errors) {
+        this.errors = errors;
+    }
+
+    public Map<String, Integer> getErrors() {
+        return errors;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/validation/Validator.java	Fri May 31 13:59:58 2013 +0200
@@ -0,0 +1,10 @@
+package de.intevation.lada.validation;
+
+import java.util.Map;
+
+
+public interface Validator
+{
+    public void validate(Object object) throws ValidationException;
+    public Map<String, Integer> getWarnings();
+}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)