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 * Default UID for serialization
40 private static final long serialVersionUID = 1L;
43 * Creates a new instance of <code>InvalidDocumentException</code> without detail message.
45 public InvalidDocumentException() {
50 * Constructs an instance of <code>InvalidDocumentException</code> with the specified detail message.
51 * @param msg the detail message.
53 public InvalidDocumentException(String msg) {
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.
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
71 public InvalidDocumentException(String message, Throwable cause) {
72 super(message, cause);
73 setErrorCode(HTTP_CODE);
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}).
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
90 public InvalidDocumentException(Throwable cause) {
92 setErrorCode(HTTP_CODE);