01: /*______________________________________________________________________________
02: *
03: * Macker http://innig.net/macker/
04: *
05: * Copyright 2002-2003 Paul Cantrell
06: *
07: * This program is free software; you can redistribute it and/or modify it under
08: * the terms of the GNU General Public License version 2, as published by the
09: * Free Software Foundation. See the file LICENSE.html for more information.
10: *
11: * This program is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
13: * FOR A PARTICULAR PURPOSE. See the license for more details.
14: *
15: * You should have received a copy of the GNU General Public License along with
16: * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
17: * Place, Suite 330 / Boston, MA 02111-1307 / USA.
18: *______________________________________________________________________________
19: */
20:
21: package net.innig.macker.event;
22:
23: import net.innig.macker.rule.Rule;
24:
25: import java.util.*;
26:
27: public class MackerIsMadException extends Exception {
28: public MackerIsMadException() {
29: super ();
30: events = null;
31: }
32:
33: public MackerIsMadException(MackerEvent event) {
34: this (Collections.singletonList(event));
35: }
36:
37: public MackerIsMadException(List/*<MackerEvent>*/events) {
38: super (BASE_MESSAGE);
39: if (events.isEmpty())
40: throw new IllegalArgumentException(
41: "Macker needs a non-empty list of things to be mad about.");
42: this .events = Collections
43: .unmodifiableList(new ArrayList(events));
44: }
45:
46: public List getEvents() {
47: return events;
48: }
49:
50: private final List events;
51:
52: private static final String BASE_MESSAGE = "Macker rules checking failed";
53: }
|