001 /**
002 *
003 * Copyright 2003-2004 The Apache Software Foundation
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 //
019 // This source code implements specifications defined by the Java
020 // Community Process. In order to remain compliant with the specification
021 // DO NOT add / change / or delete method signatures!
022 //
023
024 package javax.servlet.jsp.el;
025
026
027 /**
028 * Represents any of the exception conditions that arise during the
029 * operation evaluation of the evaluator.
030 *
031 * @since 2.0
032 */
033 public class ELException
034 extends Exception
035 {
036 //-------------------------------------
037 // Member variables
038 //-------------------------------------
039
040 private Throwable mRootCause;
041
042 //-------------------------------------
043 /**
044 * Creates an ELException with no detail message.
045 **/
046 public ELException ()
047 {
048 super ();
049 }
050
051 //-------------------------------------
052 /**
053 * Creates an ELException with the provided detail message.
054 *
055 * @param pMessage the detail message
056 **/
057 public ELException (String pMessage)
058 {
059 super (pMessage);
060 }
061
062 //-------------------------------------
063 /**
064 * Creates an ELException with the given root cause.
065 *
066 * @param pRootCause the originating cause of this exception
067 **/
068 public ELException (Throwable pRootCause)
069 {
070 super( pRootCause.getLocalizedMessage() );
071 mRootCause = pRootCause;
072 }
073
074 //-------------------------------------
075 /**
076 * Creates an ELException with the given detail message and root cause.
077 *
078 * @param pMessage the detail message
079 * @param pRootCause the originating cause of this exception
080 **/
081 public ELException (String pMessage,
082 Throwable pRootCause)
083 {
084 super (pMessage);
085 mRootCause = pRootCause;
086 }
087
088 //-------------------------------------
089 /**
090 * Returns the root cause.
091 *
092 * @return the root cause of this exception
093 */
094 public Throwable getRootCause ()
095 {
096 return mRootCause;
097 }
098 }