01 /*
02 * Copyright 2004 The Apache Software Foundation
03 *
04 * Licensed under the Apache License, Version 2.0 (the "License");
05 * you may not use this file except in compliance with the License.
06 * You may obtain a copy of the License at
07 *
08 * http://www.apache.org/licenses/LICENSE-2.0
09 *
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 javax.servlet.jsp.el;
18
19 /**
20 * Represents any of the exception conditions that arise during the
21 * operation evaluation of the evaluator.
22 *
23 * @since 2.0
24 */
25 public class ELException extends Exception {
26 //-------------------------------------
27 // Member variables
28 //-------------------------------------
29
30 private Throwable mRootCause;
31
32 //-------------------------------------
33 /**
34 * Creates an ELException with no detail message.
35 **/
36 public ELException() {
37 super ();
38 }
39
40 //-------------------------------------
41 /**
42 * Creates an ELException with the provided detail message.
43 *
44 * @param pMessage the detail message
45 **/
46 public ELException(String pMessage) {
47 super (pMessage);
48 }
49
50 //-------------------------------------
51 /**
52 * Creates an ELException with the given root cause.
53 *
54 * @param pRootCause the originating cause of this exception
55 **/
56 public ELException(Throwable pRootCause) {
57 super (pRootCause.getLocalizedMessage());
58 mRootCause = pRootCause;
59 }
60
61 //-------------------------------------
62 /**
63 * Creates an ELException with the given detail message and root cause.
64 *
65 * @param pMessage the detail message
66 * @param pRootCause the originating cause of this exception
67 **/
68 public ELException(String pMessage, Throwable pRootCause) {
69 super (pMessage);
70 mRootCause = pRootCause;
71 }
72
73 //-------------------------------------
74 /**
75 * Returns the root cause.
76 *
77 * @return the root cause of this exception
78 */
79 public Throwable getRootCause() {
80 return mRootCause;
81 }
82 }
|