1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 package net.sf.tomp.xml.include;
31
32 /***
33 * <p>
34 * <code>XIncludeException</code> is the generic superclass for all checked
35 * exceptions that may be thrown as a result of a violation of XInclude's rules.
36 * </p>
37 *
38 * @author Elliotte Rusty Harold
39 * @version 1.0d9, July 4, 2002
40 */
41 public class XIncludeException extends Exception {
42 private Throwable rootCause = null;
43
44 /***
45 * Constructs an <code>XIncludeException</code> with <code>null</code>
46 * as its error detail message.
47 */
48 public XIncludeException() {
49 }
50
51 /***
52 * Constructs an <code>XIncludeException</code> with the specified detail
53 * message. The error message string <code>message</code> can later be
54 * retrieved by the <code>{@link java.lang.Throwable#getMessage}</code>
55 * method of class <code>java.lang.Throwable</code>.
56 *
57 * @param message the detail message.
58 */
59 public XIncludeException(String message) {
60 super(message);
61 }
62
63 /***
64 * When an <code>IOException</code>,<code>MalformedURLException</code>
65 * or other generic exception is thrown while processing an XML document for
66 * XIncludes, it is customarily replaced by some form of
67 * <code>XIncludeException</code>. This method allows you to store the
68 * original exception.
69 *
70 * @param nestedException the underlying exception which caused the
71 * XIncludeException to be thrown
72 */
73 public void setRootCause(Throwable nestedException) {
74 this.rootCause = nestedException;
75 }
76
77 /***
78 * When an <code>IOException</code>,<code>MalformedURLException</code>
79 * or other generic exception is thrown while processing an XML document for
80 * XIncludes, it is customarily replaced by some form of
81 * <code>XIncludeException</code>. This method allows you to retrieve the
82 * original exception. It returns null if no such exception caused this
83 * <code>XIncludeException</code>.
84 *
85 * @return Throwable the underlying exception which caused the
86 * XIncludeException to be thrown
87 */
88 public Throwable getRootCause() {
89 return this.rootCause;
90 }
91 }
92
93
94
95
96
97
98
99
100
101
102