📄 tilesexception.java
字号:
/*
* $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/TilesException.java,v 1.5 2004/03/14 06:23:43 sraeburn Exp $
* $Revision: 1.5 $
* $Date: 2004/03/14 06:23:43 $
*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.struts.tiles;
/**
* Root class for all Tiles-exceptions.
*/
public class TilesException extends Exception
{
/**
* Any "wrapped" exception will be exposed when this is serialized.
* @serial
*/
private Exception exception;
/**
* Constructor.
*/
public TilesException()
{
super();
this.exception = null;
}
/**
* Constructor.
* @param message The error or warning message.
*/
public TilesException(String message)
{
super(message);
this.exception = null;
}
/**
* Create a new <code>TilesException</code> wrapping an existing exception.
*
* <p>The existing exception will be embedded in the new
* one, and its message will become the default message for
* the TilesException.</p>
*
* @param e The exception to be wrapped.
*/
public TilesException(Exception e)
{
super();
this.exception = e;
}
/**
* Create a new <code>TilesException</code> from an existing exception.
*
* <p>The existing exception will be embedded in the new
* one, but the new exception will have its own message.</p>
*
* @param message The detail message.
* @param e The exception to be wrapped.
*/
public TilesException(String message, Exception e)
{
super(message);
this.exception = e;
}
/**
* Return a detail message for this exception.
*
* <p>If there is a embedded exception, and if the TilesException
* has no detail message of its own, this method will return
* the detail message from the embedded exception.</p>
*
* @return The error or warning message.
*/
public String getMessage ()
{
String message = super.getMessage ();
if (message == null && exception != null) {
return exception.getMessage();
} else {
return message;
}
}
/**
* Return the embedded exception, if any.
*
* @return The embedded exception, or <code>null</code> if there is none.
*/
public Exception getException ()
{
return exception;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -