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