Mercurial > lada > lada-server
view src/main/java/de/intevation/lada/validation/ValidationException.java @ 116:92affd9467f8
Added warnings to ValidationException.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 12 Jun 2013 14:43:46 +0200 |
parents | 9e34b7e872f9 |
children | 567ce7697fc7 |
line wrap: on
line source
package de.intevation.lada.validation; import java.util.HashMap; import java.util.Map; /** * Exception used for validation errors. * * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> */ public class ValidationException extends Exception { /** * Errors saved in this exception. */ private Map<String, Integer> errors; /** * Warnings saved in this exception. */ private Map<String, Integer> warnings; /** * Do not allow an empty ValidationException object. */ private ValidationException() { } /** * Create a new instance with errors. * * @param errors */ public ValidationException(Map<String, Integer> errors) { this(); this.errors = errors; this.warnings = new HashMap<String, Integer>(); } /** * Create a new instance with errors and warnings. * * @param errors */ public ValidationException( Map<String, Integer> errors, Map<String, Integer> warnings ) { this(); this.errors = errors; this.warnings = warnings; } /** * Getter for the errors. * * @return */ public Map<String, Integer> getErrors() { return errors; } /** * Getter for the warnings. * * @return */ public Map<String, Integer> getWarnings() { return warnings; } }