Make List type safe. Remove/suppress all warnings.
[marc4j.git] / src / org / marc4j / marc / IllegalAddException.java
1 // $Id: IllegalAddException.java,v 1.7 2005/05/04 10:06:47 bpeters Exp $\r
2 /**\r
3  * Copyright (C) 2004 Bas Peters (mail@bpeters.com)\r
4  *\r
5  * This file is part of MARC4J\r
6  *\r
7  * MARC4J is free software; you can redistribute it and/or\r
8  * modify it under the terms of the GNU Lesser General Public \r
9  * License as published by the Free Software Foundation; either \r
10  * version 2.1 of the License, or (at your option) any later version.\r
11  *\r
12  * MARC4J is distributed in the hope that it will be useful,\r
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
15  * Lesser General Public License for more details.\r
16  *\r
17  * You should have received a copy of the GNU Lesser General Public \r
18  * License along with MARC4J; if not, write to the Free Software\r
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
20  */\r
21 package org.marc4j.marc;\r
22 \r
23 /**\r
24  * Thrown when the addition of the supplied object is illegal.\r
25  *\r
26  * @author Bas Peters\r
27  * @version $Revision: 1.7 $\r
28  */\r
29 public class IllegalAddException \r
30     extends IllegalArgumentException {\r
31 \r
32     /**\r
33    * \r
34    */\r
35   private static final long serialVersionUID = 8756226018321264604L;\r
36 \r
37     /**\r
38      * Creates a new <code>Exception</code> indicating that the addttion\r
39      * of the supplied object is illegal.\r
40      *\r
41      * @param className the class name\r
42      */\r
43     public IllegalAddException(String className) {\r
44         super(new StringBuffer()\r
45             .append("The addition of the object of type ")\r
46             .append(className)\r
47             .append(" is not allowed.")\r
48             .toString());\r
49   }\r
50 \r
51     /**\r
52      * Creates a new <code>Exception</code> indicating that the addttion\r
53      * of the supplied object is illegal.\r
54      *\r
55      * @param className the class name\r
56      * @param reason the reason why the exception is thrown\r
57      */\r
58     public IllegalAddException(String className, String reason) {\r
59         super(new StringBuffer()\r
60             .append("The addition of the object of type ")\r
61             .append(className)\r
62             .append(" is not allowed: ")\r
63             .append(reason)\r
64             .append(".")\r
65             .toString());\r
66   }\r
67 \r
68 }\r