KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > lang > jstl > ELException


1 /*
2  * Copyright 1999-2004 The 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 package org.apache.taglibs.standard.lang.jstl;
18
19
20 /**
21  *
22  * Represents any of the exception conditions that arise during the
23  * operation evaluation of the evaluator.
24  *
25  * @author Nathan Abramson - Art Technology Group
26  * @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: pierred $
27  **/

28
29 public class ELException
30   extends Exception JavaDoc
31 {
32   //-------------------------------------
33
// Member variables
34
//-------------------------------------
35

36   Throwable JavaDoc mRootCause;
37
38   //-------------------------------------
39
/**
40    *
41    * Constructor
42    **/

43   public ELException ()
44   {
45     super ();
46   }
47
48   //-------------------------------------
49
/**
50    *
51    * Constructor
52    **/

53   public ELException (String JavaDoc pMessage)
54   {
55     super (pMessage);
56   }
57
58   //-------------------------------------
59
/**
60    *
61    * Constructor
62    **/

63   public ELException (Throwable JavaDoc pRootCause)
64   {
65     mRootCause = pRootCause;
66   }
67
68   //-------------------------------------
69
/**
70    *
71    * Constructor
72    **/

73   public ELException (String JavaDoc pMessage,
74               Throwable JavaDoc pRootCause)
75   {
76     super (pMessage);
77     mRootCause = pRootCause;
78   }
79
80   //-------------------------------------
81
/**
82    *
83    * Returns the root cause
84    **/

85   public Throwable JavaDoc getRootCause ()
86   {
87     return mRootCause;
88   }
89
90   //-------------------------------------
91
/**
92    *
93    * String representation
94    **/

95   public String JavaDoc toString ()
96   {
97     if (getMessage () == null) {
98       return mRootCause.toString ();
99     }
100     else if (mRootCause == null) {
101       return getMessage ();
102     }
103     else {
104       return getMessage () + ": " + mRootCause;
105     }
106   }
107
108   //-------------------------------------
109
}
110
Popular Tags