Mercurial > lada > lada-server
changeset 64:132eca870434
New validator for LProbe.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 31 May 2013 14:00:25 +0200 (2013-05-31) |
parents | 7dc8a1579e39 |
children | 8078fde8b02b |
files | src/main/java/de/intevation/lada/validation/LProbeValidator.java |
diffstat | 1 files changed, 36 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/LProbeValidator.java Fri May 31 14:00:25 2013 +0200 @@ -0,0 +1,36 @@ +package de.intevation.lada.validation; + +import java.util.HashMap; +import java.util.Map; + +import javax.inject.Named; + +@Named("lprobevalidator") +public class LProbeValidator +implements Validator +{ + + private Map<String, Integer> warnings; + + @Override + public void validate(Object probe) + throws ValidationException { + warnings = new HashMap<String, Integer>(); + warnings.put("entnahmeort", 612); + validateId(probe); + } + + private void validateId(Object probe) + throws ValidationException{ + Map<String, Integer> errors = new HashMap<String, Integer>(); + // TODO Implement me! + errors.put("probeid", 611); + ValidationException ve = new ValidationException(errors); + throw ve; + } + + @Override + public Map<String, Integer> getWarnings() { + return warnings; + } +}