KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hssf > eventusermodel > HSSFUserException


1 /* ====================================================================
2    Copyright 2002-2004 Apache Software Foundation
3
4    Licensed under the Apache License, Version 2.0 (the "License");
5    you may not use this file except in compliance with the License.
6    You may obtain a copy of the License at
7
8        http://www.apache.org/licenses/LICENSE-2.0
9
10    Unless required by applicable law or agreed to in writing, software
11    distributed under the License is distributed on an "AS IS" BASIS,
12    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    See the License for the specific language governing permissions and
14    limitations under the License.
15 ==================================================================== */

16
17
18 package org.apache.poi.hssf.eventusermodel;
19
20 /**
21  * <p>This exception is provided as a way for API users to throw
22  * exceptions from their event handling code. By doing so they
23  * abort file processing by the HSSFEventFactory and by
24  * catching it from outside the HSSFEventFactory.processEvents
25  * method they can diagnose the cause for the abort.</p>
26  *
27  * <p>The HSSFUserException supports a nested "reason"
28  * throwable, i.e. an exception that caused this one to be thrown.</p>
29  *
30  * <p>The HSSF package does not itself throw any of these
31  * exceptions.</p>
32  *
33  * @author Rainer Klute (klute@rainer-klute.de)
34  * @author Carey Sublette (careysub@earthling.net)
35  * @version HSSFUserException.java,v 1.0
36  * @since 2002-04-19
37  */

38 public class HSSFUserException extends Exception JavaDoc
39 {
40
41     private Throwable JavaDoc reason;
42
43
44
45     /**
46      * <p>Creates a new {@link HSSFUserException}.</p>
47      */

48     public HSSFUserException()
49     {
50         super();
51     }
52
53
54
55     /**
56      * <p>Creates a new {@link HSSFUserException} with a message
57      * string.</p>
58      */

59     public HSSFUserException(final String JavaDoc msg)
60     {
61         super(msg);
62     }
63
64
65
66     /**
67      * <p>Creates a new {@link HSSFUserException} with a reason.</p>
68      */

69     public HSSFUserException(final Throwable JavaDoc reason)
70     {
71         super();
72         this.reason = reason;
73     }
74
75
76
77     /**
78      * <p>Creates a new {@link HSSFUserException} with a message string
79      * and a reason.</p>
80      */

81     public HSSFUserException(final String JavaDoc msg, final Throwable JavaDoc reason)
82     {
83         super(msg);
84         this.reason = reason;
85     }
86
87
88
89     /**
90      * <p>Returns the {@link Throwable} that caused this exception to
91      * be thrown or <code>null</code> if there was no such {@link
92      * Throwable}.</p>
93      */

94     public Throwable JavaDoc getReason()
95     {
96         return reason;
97     }
98
99 }
100
Popular Tags