KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > util > ValidationException


1 package org.tigris.scarab.util;
2
3 import org.tigris.scarab.tools.localization.L10NMessage;
4 import org.tigris.scarab.tools.localization.LocalizationKey;
5
6 /* ================================================================
7  * Copyright (c) 2000-2002 CollabNet. All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are
11  * met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in the
18  * documentation and/or other materials provided with the distribution.
19  *
20  * 3. The end-user documentation included with the redistribution, if
21  * any, must include the following acknowlegement: "This product includes
22  * software developed by Collab.Net <http://www.Collab.Net/>."
23  * Alternately, this acknowlegement may appear in the software itself, if
24  * and wherever such third-party acknowlegements normally appear.
25  *
26  * 4. The hosted project names must not be used to endorse or promote
27  * products derived from this software without prior written
28  * permission. For written permission, please contact info@collab.net.
29  *
30  * 5. Products derived from this software may not use the "Tigris" or
31  * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without
32  * prior written permission of Collab.Net.
33  *
34  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
35  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
36  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
37  * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
38  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
40  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
42  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
43  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
44  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45  *
46  * ====================================================================
47  *
48  * This software consists of voluntary contributions made by many
49  * individuals on behalf of Collab.Net.
50  */

51
52 /**
53     This class extends ScarabException and does not change its
54     functionality. It is thrown when an attempt to modify the database
55     would result in a bad state.
56     
57     @author <a HREF="mailto:jmcnally@collab.net">John D. McNally</a>
58     @version $Id: ValidationException.java 9104 2004-05-10 21:04:51Z dabbous $
59 */

60 public class ValidationException extends ScarabException
61 {
62     /**
63      * Constructs a new <code>ValidationException</code> with specified
64      * detail message.
65      *
66      * @param msg the error message.
67      */

68     public ValidationException(LocalizationKey l10nKey)
69     {
70         super(l10nKey);
71     }
72
73     /**
74      * Constructs a new <code>ValidationException</code> with specified
75      * detail message.
76      *
77      * @param msg the error message.
78      */

79     public ValidationException(L10NMessage l10nMessage)
80     {
81         super(l10nMessage);
82     }
83  
84     /**
85      * Constructs a new <code>ValidationException</code> with specified
86      * detail message.
87      *
88      * @param msg the error message.
89      */

90     public ValidationException(L10NMessage l10nMessage, Throwable JavaDoc nested)
91     {
92         super(l10nMessage, nested);
93     }
94  
95     /**
96      * Constructs a new <code>ValidationException</code> with specified
97      * resource and a list of parameters.
98      * @param theKey the l10n error key.
99      */

100     public ValidationException (LocalizationKey theKey, Object JavaDoc[] theParams)
101     {
102         super(theKey,theParams);
103     }
104
105     /**
106      * convenience constructor: Constructs a new <code>ScarabException</code>
107      * with specified resource and one parameter.
108      * @param theKey the l10n error key.
109      */

110     public ValidationException (LocalizationKey theKey, Object JavaDoc p1)
111     {
112         this(theKey, new Object JavaDoc[] {p1});
113     }
114  
115     /**
116      * convenience constructor: Constructs a new <code>ScarabException</code>
117      * with specified resource and two parameters.
118      * @param theKey the l10n error key.
119      */

120     public ValidationException (LocalizationKey theKey, Object JavaDoc p1, Object JavaDoc p2)
121     {
122         this(theKey, new Object JavaDoc[] {p1, p2});
123     }
124  
125     /**
126      * convenience constructor: Constructs a new <code>ScarabException</code>
127      * with specified resource and three parameters.
128      * @param theKey the l10n error key.
129      */

130     public ValidationException(LocalizationKey theKey, Object JavaDoc p1, Object JavaDoc p2, Object JavaDoc p3)
131     {
132         this(theKey, new Object JavaDoc[] {p1, p2, p3});
133     }
134
135  
136     /**
137      * convenience constructor: Constructs a new <code>ScarabException</code>
138      * with specified resource, nested Throwable and an aritrary set of parameters.
139      * @param theKey the l10n error key.
140      */

141     public ValidationException(LocalizationKey theKey, Throwable JavaDoc nested, Object JavaDoc[] theParams)
142     {
143         super(theKey, nested, theParams);
144     }
145     
146 }
147
Popular Tags