KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hpsf > HPSFException


1
2 /* ====================================================================
3    Copyright 2002-2004 Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    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.poi.hpsf;
19
20 /**
21  * <p>This exception is the superclass of all other checked exceptions
22  * thrown in this package. It supports a nested "reason" throwable,
23  * i.e. an exception that caused this one to be thrown.</p>
24  *
25  * @author Rainer Klute <a
26  * HREF="mailto:klute@rainer-klute.de">&lt;klute@rainer-klute.de&gt;</a>
27  * @version $Id: HPSFException.java,v 1.9 2004/04/09 13:05:16 glens Exp $
28  * @since 2002-02-09
29  */

30 public class HPSFException extends Exception JavaDoc
31 {
32
33     /**
34      * <p>The underlying reason for this exception - may be
35      * <code>null</code>.</p>
36      * */

37     private Throwable JavaDoc reason;
38
39
40
41     /**
42      * <p>Creates an {@link HPSFException}.</p>
43      */

44     public HPSFException()
45     {
46         super();
47     }
48
49
50
51     /**
52      * <p>Creates an {@link HPSFException} with a message string.</p>
53      *
54      * @param msg The message string.
55      */

56     public HPSFException(final String JavaDoc msg)
57     {
58         super(msg);
59     }
60
61
62
63     /**
64      * <p>Creates a new {@link HPSFException} with a reason.</p>
65      *
66      * @param reason The reason, i.e. a throwable that indirectly
67      * caused this exception.
68      */

69     public HPSFException(final Throwable JavaDoc reason)
70     {
71         super();
72         this.reason = reason;
73     }
74
75
76
77     /**
78      * <p>Creates an {@link HPSFException} with a message string and a
79      * reason.</p>
80      *
81      * @param msg The message string.
82      * @param reason The reason, i.e. a throwable that indirectly
83      * caused this exception.
84      */

85     public HPSFException(final String JavaDoc msg, final Throwable JavaDoc reason)
86     {
87         super(msg);
88         this.reason = reason;
89     }
90
91
92
93     /**
94      * <p>Returns the {@link Throwable} that caused this exception to
95      * be thrown or <code>null</code> if there was no such {@link
96      * Throwable}.</p>
97      *
98      * @return The reason
99      */

100     public Throwable JavaDoc getReason()
101     {
102         return reason;
103     }
104
105 }
106
Popular Tags