View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.commons.jxpath;
19  
20  /**
21   * Thrown when a problem with configuration with the {@link JXPathContextFactory JXPathContextFactories} exists. This error will typically be thrown when the
22   * class of a factory specified in the system properties cannot be found or instantiated.
23   */
24  public class JXPathContextFactoryConfigurationError extends Error {
25  
26      private static final long serialVersionUID = 2L;
27  
28      /**
29       * Constructs a new {@code JXPathContextFactoryConfigurationError} with no detail mesage.
30       */
31      public JXPathContextFactoryConfigurationError() {
32      }
33  
34      /**
35       * Constructs a new {@code JXPathContextFactoryConfigurationError} with a given {@code Exception} base cause of the error.
36       *
37       * @param cause The exception to be encapsulated in a JXPathContextFactoryConfigurationError.
38       */
39      public JXPathContextFactoryConfigurationError(final Exception cause) {
40          super(cause);
41      }
42  
43      /**
44       * Constructs a new {@code JXPathContextFactoryConfigurationError} with the given {@code Exception} base cause and detail message.
45       *
46       * @param cause   The exception to be encapsulated in a JXPathContextFactoryConfigurationError
47       * @param msg The detail message.
48       */
49      public JXPathContextFactoryConfigurationError(final Exception cause, final String msg) {
50          super(msg, cause);
51      }
52  
53      /**
54       * Constructs a new {@code JXPathContextFactoryConfigurationError} with the {@code String } specified as an error message.
55       *
56       * @param msg The error message for the exception.
57       */
58      public JXPathContextFactoryConfigurationError(final String msg) {
59          super(msg);
60      }
61  
62      /**
63       * Gets the actual exception (if any) that caused this exception to be raised.
64       *
65       * @return The encapsulated exception, or null if there is none.
66       */
67      public Exception getException() {
68          return (Exception) super.getCause();
69      }
70  
71  }