franta-hg@16: /** franta-hg@16: * SQL-DK franta-hg@16: * Copyright © 2013 František Kučera (frantovo.cz) franta-hg@16: * franta-hg@16: * This program is free software: you can redistribute it and/or modify franta-hg@16: * it under the terms of the GNU General Public License as published by franta-hg@16: * the Free Software Foundation, either version 3 of the License, or franta-hg@16: * (at your option) any later version. franta-hg@16: * franta-hg@16: * This program is distributed in the hope that it will be useful, franta-hg@16: * but WITHOUT ANY WARRANTY; without even the implied warranty of franta-hg@16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the franta-hg@16: * GNU General Public License for more details. franta-hg@16: * franta-hg@16: * You should have received a copy of the GNU General Public License franta-hg@16: * along with this program. If not, see . franta-hg@16: */ franta-hg@1: package info.globalcode.sql.dk; franta-hg@1: franta-hg@1: import java.util.ArrayList; franta-hg@1: import java.util.Collection; franta-hg@1: import java.util.Collections; franta-hg@1: franta-hg@1: /** franta-hg@1: * franta-hg@1: * @author Ing. František Kučera (frantovo.cz) franta-hg@1: */ franta-hg@1: public class InvalidOptionsException extends Exception { franta-hg@1: franta-hg@1: private final Collection problems = new ArrayList<>(); franta-hg@1: franta-hg@1: public Collection getProblems() { franta-hg@1: return Collections.unmodifiableCollection(problems); franta-hg@1: } franta-hg@1: franta-hg@1: public void addProblem(OptionProblem p) { franta-hg@1: problems.add(p); franta-hg@1: } franta-hg@1: franta-hg@1: public boolean hasProblems() { franta-hg@1: return !problems.isEmpty(); franta-hg@1: } franta-hg@1: franta-hg@1: public static class OptionProblem { franta-hg@1: franta-hg@1: private String description; franta-hg@63: private Throwable exception; franta-hg@1: franta-hg@1: public OptionProblem(String description) { franta-hg@1: this.description = description; franta-hg@1: } franta-hg@1: franta-hg@63: public OptionProblem(String description, Throwable exception) { franta-hg@63: this.description = description; franta-hg@63: this.exception = exception; franta-hg@63: } franta-hg@63: franta-hg@1: public String getDescription() { franta-hg@1: return description; franta-hg@1: } franta-hg@63: franta-hg@63: public Throwable getException() { franta-hg@63: return exception; franta-hg@63: } franta-hg@1: } franta-hg@1: }