001: package org.tigris.scarab.util;
002:
003: import org.tigris.scarab.tools.localization.L10NMessage;
004: import org.tigris.scarab.tools.localization.LocalizationKey;
005:
006: /* ================================================================
007: * Copyright (c) 2000-2002 CollabNet. All rights reserved.
008: *
009: * Redistribution and use in source and binary forms, with or without
010: * modification, are permitted provided that the following conditions are
011: * met:
012: *
013: * 1. Redistributions of source code must retain the above copyright
014: * notice, this list of conditions and the following disclaimer.
015: *
016: * 2. Redistributions in binary form must reproduce the above copyright
017: * notice, this list of conditions and the following disclaimer in the
018: * documentation and/or other materials provided with the distribution.
019: *
020: * 3. The end-user documentation included with the redistribution, if
021: * any, must include the following acknowlegement: "This product includes
022: * software developed by Collab.Net <http://www.Collab.Net/>."
023: * Alternately, this acknowlegement may appear in the software itself, if
024: * and wherever such third-party acknowlegements normally appear.
025: *
026: * 4. The hosted project names must not be used to endorse or promote
027: * products derived from this software without prior written
028: * permission. For written permission, please contact info@collab.net.
029: *
030: * 5. Products derived from this software may not use the "Tigris" or
031: * "Scarab" names nor may "Tigris" or "Scarab" appear in their names without
032: * prior written permission of Collab.Net.
033: *
034: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
035: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
036: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
037: * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
038: * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
039: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
040: * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
041: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
042: * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
043: * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
044: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
045: *
046: * ====================================================================
047: *
048: * This software consists of voluntary contributions made by many
049: * individuals on behalf of Collab.Net.
050: */
051:
052: /**
053: This class extends ScarabException and does not change its
054: functionality. It is thrown when an attempt to modify the database
055: would result in a bad state.
056:
057: @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
058: @version $Id: ValidationException.java 9104 2004-05-10 21:04:51Z dabbous $
059: */
060: public class ValidationException extends ScarabException {
061: /**
062: * Constructs a new <code>ValidationException</code> with specified
063: * detail message.
064: *
065: * @param msg the error message.
066: */
067: public ValidationException(LocalizationKey l10nKey) {
068: super (l10nKey);
069: }
070:
071: /**
072: * Constructs a new <code>ValidationException</code> with specified
073: * detail message.
074: *
075: * @param msg the error message.
076: */
077: public ValidationException(L10NMessage l10nMessage) {
078: super (l10nMessage);
079: }
080:
081: /**
082: * Constructs a new <code>ValidationException</code> with specified
083: * detail message.
084: *
085: * @param msg the error message.
086: */
087: public ValidationException(L10NMessage l10nMessage, Throwable nested) {
088: super (l10nMessage, nested);
089: }
090:
091: /**
092: * Constructs a new <code>ValidationException</code> with specified
093: * resource and a list of parameters.
094: * @param theKey the l10n error key.
095: */
096: public ValidationException(LocalizationKey theKey,
097: Object[] theParams) {
098: super (theKey, theParams);
099: }
100:
101: /**
102: * convenience constructor: Constructs a new <code>ScarabException</code>
103: * with specified resource and one parameter.
104: * @param theKey the l10n error key.
105: */
106: public ValidationException(LocalizationKey theKey, Object p1) {
107: this (theKey, new Object[] { p1 });
108: }
109:
110: /**
111: * convenience constructor: Constructs a new <code>ScarabException</code>
112: * with specified resource and two parameters.
113: * @param theKey the l10n error key.
114: */
115: public ValidationException(LocalizationKey theKey, Object p1,
116: Object p2) {
117: this (theKey, new Object[] { p1, p2 });
118: }
119:
120: /**
121: * convenience constructor: Constructs a new <code>ScarabException</code>
122: * with specified resource and three parameters.
123: * @param theKey the l10n error key.
124: */
125: public ValidationException(LocalizationKey theKey, Object p1,
126: Object p2, Object p3) {
127: this (theKey, new Object[] { p1, p2, p3 });
128: }
129:
130: /**
131: * convenience constructor: Constructs a new <code>ScarabException</code>
132: * with specified resource, nested Throwable and an aritrary set of parameters.
133: * @param theKey the l10n error key.
134: */
135: public ValidationException(LocalizationKey theKey,
136: Throwable nested, Object[] theParams) {
137: super(theKey, nested, theParams);
138: }
139:
140: }
|