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:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright 2009 University of California at Berkeley
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
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.
25 * To change this template, choose Tools | Templates
26 * and open the template in the editor.
28 package org.collectionspace.services.common.document;
31 * InvalidDocumentException is used to indicate one or more parts of service
32 * document has failed to validate
35 public class InvalidDocumentException extends BadRequestException {
38 * Creates a new instance of <code>InvalidDocumentException</code> without detail message.
40 public InvalidDocumentException() {
44 * Constructs an instance of <code>InvalidDocumentException</code> with the specified detail message.
45 * @param msg the detail message.
47 public InvalidDocumentException(String msg) {
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.
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
65 public InvalidDocumentException(String message, Throwable cause) {
66 super(message, cause);
67 setErrorCode(HTTP_CODE);
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}).
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
84 public InvalidDocumentException(Throwable cause) {
86 setErrorCode(HTTP_CODE);