# HG changeset patch # User Raimund Renkert # Date 1371108496 -7200 # Node ID ab094cd8d78bd7e41b9bd53851358955ca919c1c # Parent 410a3a25b3e9f3f38dbcff151cae41da1b321f7a New validator for LMessung. diff -r 410a3a25b3e9 -r ab094cd8d78b src/main/java/de/intevation/lada/validation/LMessungValidator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/de/intevation/lada/validation/LMessungValidator.java Thu Jun 13 09:28:16 2013 +0200 @@ -0,0 +1,37 @@ +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.LMessung; + +/** + * Validator for LMessung objects. + * + * @author Raimund Renkert + */ +@Named("lmessungvalidator") +@ApplicationScoped +public class LMessungValidator +implements Validator +{ + + @Override + public Map validate(Object object) + throws ValidationException { + Map warnings = new HashMap(); + if (!(object instanceof LMessung)) { + Map errors = new HashMap(); + errors.put("lmessung", 610); + throw new ValidationException(errors); + } + LMessung messung = (LMessung)object; + + //TODO: mode validation, see LSB: VI - Konsistenzregeln. + return warnings; + } + +}