]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
c1000e963a1067a2c2394e6f5be0dca1da464b71
[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          * Default UID for serialization
39          */
40         private static final long serialVersionUID = 1L;
41
42         /**
43      * Creates a new instance of <code>InvalidDocumentException</code> without detail message.
44      */
45     public InvalidDocumentException() {
46         //empty constructor
47     }
48
49     /**
50      * Constructs an instance of <code>InvalidDocumentException</code> with the specified detail message.
51      * @param msg the detail message.
52      */
53     public InvalidDocumentException(String msg) {
54         super(msg);
55     }
56
57     /**
58      * Constructs a new exception with the specified detail message and
59      * cause.  <p>Note that the detail message associated with
60      * <code>cause</code> is <i>not</i> automatically incorporated in
61      * this exception's detail message.
62      *
63      * @param  message the detail message (which is saved for later retrieval
64      *         by the {@link #getMessage()} method).
65      * @param  cause the cause (which is saved for later retrieval by the
66      *         {@link #getCause()} method).  (A <tt>null</tt> value is
67      *         permitted, and indicates that the cause is nonexistent or
68      *         unknown.)
69      * @since  1.4
70      */
71     public InvalidDocumentException(String message, Throwable cause) {
72         super(message, cause);
73         setErrorCode(HTTP_CODE);
74     }
75
76     /**
77      * Constructs a new exception with the specified cause and a detail
78      * message of <tt>(cause==null ? null : cause.toString())</tt> (which
79      * typically contains the class and detail message of <tt>cause</tt>).
80      * This constructor is useful for exceptions that are little more than
81      * wrappers for other throwables (for example, {@link
82      * java.security.PrivilegedActionException}).
83      *
84      * @param  cause the cause (which is saved for later retrieval by the
85      *         {@link #getCause()} method).  (A <tt>null</tt> value is
86      *         permitted, and indicates that the cause is nonexistent or
87      *         unknown.)
88      * @since  1.4
89      */
90     public InvalidDocumentException(Throwable cause) {
91         super(cause);
92         setErrorCode(HTTP_CODE);
93     }
94 }