view src/main/java/de/intevation/lada/validation/ValidationException.java @ 409:183f8116d9a6

Added license header to source files.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 20 Jan 2014 12:27:00 +0100
parents 567ce7697fc7
children
line wrap: on
line source
/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU GPL (v>=3) 
 * and comes with ABSOLUTELY NO WARRANTY! Check out 
 * the documentation coming with IMIS-Labordaten-Application for details. 
 */
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 the errors
     */
    public Map<String, Integer> getErrors() {
        return errors;
    }

    /**
     * Getter for the warnings.
     *
     * @return the warnings
     */
    public Map<String, Integer> getWarnings() {
        return warnings;
    }
}
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)