1 /*
2 * SPDX-FileCopyrightText: none
3 * SPDX-License-Identifier: CC0-1.0
4 */
5
6 package gov.nist.secauto.metaschema.core.model.constraint;
7
8 import edu.umd.cs.findbugs.annotations.Nullable;
9
10 /**
11 * Indicates a constraint validation failure.
12 */
13 public class ConstraintValidationException
14 extends Exception {
15
16 /**
17 * the serial version UID.
18 */
19 private static final long serialVersionUID = 2L;
20
21 /**
22 * Constructs a new exception with the specified detail message. The cause is
23 * not initialized, and may subsequently be initialized by a call to
24 * {@link #initCause}.
25 *
26 * @param message
27 * the detail message, which is saved for later retrieval by the
28 * {@link #getMessage()} method.
29 */
30 public ConstraintValidationException(@Nullable String message) {
31 super(message);
32 }
33
34 /**
35 * Constructs a new exception with the specified cause.
36 * <p>
37 * If the cause has a detail message (i.e.
38 * {@code (cause==null ? null : cause.toString())} then the message provided by
39 * the cause will be used.
40 * <p>
41 * This constructor is useful for when this exception is raised as a wrapper of
42 * another exception.
43 *
44 * @param cause
45 * the cause (which is saved for later retrieval by the
46 * {@link #getCause()} method). A {@code null} value is permitted, and
47 * indicates that the cause is nonexistent or unknown.
48 */
49 public ConstraintValidationException(@Nullable Throwable cause) {
50 super(cause);
51 }
52
53 /**
54 * Constructs a new exception with the specified detail message and cause.
55 * <p>
56 * Note that the detail message associated with {@code cause} is <i>not</i>
57 * automatically incorporated in this exception's detail message.
58 *
59 * @param message
60 * the detail message, which is saved for later retrieval by the
61 * {@link #getMessage()} method.
62 * @param cause
63 * the cause (which is saved for later retrieval by the
64 * {@link #getCause()} method). A {@code null} value is permitted, and
65 * indicates that the cause is nonexistent or unknown.
66 */
67 public ConstraintValidationException(@Nullable String message, @Nullable Throwable cause) {
68 super(message, cause);
69 }
70 }