1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package dev.metaschema.core.metapath;
7   
8   import edu.umd.cs.findbugs.annotations.Nullable;
9   
10  /**
11   * <a href= "https://www.w3.org/TR/xpath-31/#ERRXPDY0002">err:MPDY0002</a>: It
12   * is a <a href="https://www.w3.org/TR/xpath-31/#dt-dynamic-error">dynamic
13   * error</a> if evaluation of an expression relies on some part of the
14   * <a href="https://www.w3.org/TR/xpath-31/#dt-dynamic-context">dynamic
15   * context</a> that is
16   * <a href="https://www.w3.org/TR/xpath-datamodel-31/#dt-absent">absent</a>.
17   */
18  public class ContextAbsentDynamicMetapathException
19      extends DynamicMetapathException {
20  
21    private static final long serialVersionUID = 1L;
22  
23    /**
24     * Constructs a new exception with the provided {@code message} and no cause.
25     *
26     * @param message
27     *          the exception message
28     */
29    public ContextAbsentDynamicMetapathException(@Nullable String message) {
30      super(DYNAMIC_CONTEXT_ABSENT, message);
31    }
32  
33    /**
34     * Constructs a new exception with the provided {@code message} and
35     * {@code cause}.
36     *
37     * @param message
38     *          the exception message
39     * @param cause
40     *          the original exception cause
41     */
42    public ContextAbsentDynamicMetapathException(
43        @Nullable String message,
44        @Nullable Throwable cause) {
45      super(DYNAMIC_CONTEXT_ABSENT, message, cause);
46    }
47  
48    /**
49     * Constructs a new exception with the provided {@code cause} and no message.
50     *
51     * @param cause
52     *          the original exception cause
53     */
54    public ContextAbsentDynamicMetapathException(@Nullable Throwable cause) {
55      super(DYNAMIC_CONTEXT_ABSENT, cause);
56    }
57  }