]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
0abded31b2b3020ecab62f77e5dd087e711348f0
[tmp/jakarta-migration.git] /
1 /**
2  *  This document is a part of the source code and related artifacts
3  *  for CollectionSpace, an open source collections management system
4  *  for museums and related institutions:
5
6  *  http://www.collectionspace.org
7  *  http://wiki.collectionspace.org
8
9  *  Copyright 2009 University of California at Berkeley
10
11  *  Licensed under the Educational Community License (ECL), Version 2.0.
12  *  You may not use this file except in compliance with this License.
13
14  *  You may obtain a copy of the ECL 2.0 License at
15
16  *  https://source.collectionspace.org/collection-space/LICENSE.txt
17
18  *  Unless required by applicable law or agreed to in writing, software
19  *  distributed under the License is distributed on an "AS IS" BASIS,
20  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  *  See the License for the specific language governing permissions and
22  *  limitations under the License.
23  */
24 /*
25  * To change this template, choose Tools | Templates
26  * and open the template in the editor.
27  */
28 package org.collectionspace.services.common.document;
29
30 /**
31  * InvalidDocumentException is used to indicate one or more parts of service
32  * document has failed to validate
33  * @author 
34  */
35 public class InvalidDocumentException extends BadRequestException {
36
37     /**
38      * Creates a new instance of <code>InvalidDocumentException</code> without detail message.
39      */
40     public InvalidDocumentException() {
41     }
42
43     /**
44      * Constructs an instance of <code>InvalidDocumentException</code> with the specified detail message.
45      * @param msg the detail message.
46      */
47     public InvalidDocumentException(String msg) {
48         super(msg);
49     }
50
51     /**
52      * Constructs a new exception with the specified detail message and
53      * cause.  <p>Note that the detail message associated with
54      * <code>cause</code> is <i>not</i> automatically incorporated in
55      * this exception's detail message.
56      *
57      * @param  message the detail message (which is saved for later retrieval
58      *         by the {@link #getMessage()} method).
59      * @param  cause the cause (which is saved for later retrieval by the
60      *         {@link #getCause()} method).  (A <tt>null</tt> value is
61      *         permitted, and indicates that the cause is nonexistent or
62      *         unknown.)
63      * @since  1.4
64      */
65     public InvalidDocumentException(String message, Throwable cause) {
66         super(message, cause);
67         setErrorCode(HTTP_CODE);
68     }
69
70     /**
71      * Constructs a new exception with the specified cause and a detail
72      * message of <tt>(cause==null ? null : cause.toString())</tt> (which
73      * typically contains the class and detail message of <tt>cause</tt>).
74      * This constructor is useful for exceptions that are little more than
75      * wrappers for other throwables (for example, {@link
76      * java.security.PrivilegedActionException}).
77      *
78      * @param  cause the cause (which is saved for later retrieval by the
79      *         {@link #getCause()} method).  (A <tt>null</tt> value is
80      *         permitted, and indicates that the cause is nonexistent or
81      *         unknown.)
82      * @since  1.4
83      */
84     public InvalidDocumentException(Throwable cause) {
85         super(cause);
86         setErrorCode(HTTP_CODE);
87     }
88 }