tanghanexception.java

来自「eclipse的hibernate插件,支持eclipse2.*版本」· Java 代码 · 共 96 行

JAVA
96
字号
/* * Created on 2003-4-14 * */package com.tanghan.util;import org.apache.log4j.Logger;/** *  * ToDo_Complete 设计Tanghan专用的Exception类 * @author Jerry Tang * @version v0.1.0 * @copyright  (C) 2003 Tanghan工作组 *  */public class TanghanException extends Exception {	/**错误代码*/	protected String errorCode = "TanghanDefaultError";	/**错误列表*///	protected static ResourceBundle resource = ResourceBundle.getBundle(TanghanConfig.getProperty("ErrorCodes.Resource"));	/**额外错误列表*///	protected static ArrayList resList = null;	/**Logger的日志类*/	protected static Logger log = Log.getInstanse().getLogger("TanghanException"); 		/**得到引起额外的Exception*/	protected Throwable cause = null;		/**	 * 构造函数	public TanghanException() {		super();		init();	}	 */	/** 构造函数	 * @param message 报错信息	 */	public TanghanException(String message) {		super(message);		init();	}	/** 构造函数	 * @param message 报错信息	 * @param cause 引发的上级错误	 *  注意:在J2SDK1.4.0的Exception, 可以使用super(message, cause);	 */	public TanghanException(String message, Throwable cause) {		//super(message, cause);		super(message);		this.cause = cause;		init();	}	/** 构造函数	 * @param cause 引发的上级错误	 *  注意:在J2SDK1.4.0的Exception, 可以使用super( cause);	 */	public TanghanException(Throwable cause) {		//super(cause);		super(cause.getMessage());		this.cause = cause;		init();	}	/**初始化ErrorCode<br>	 * 在继承TanghanException,必须覆盖该方法。	 * */	protected void init(){		setErrorCode("TanghanDefaultError");	}	/**	 * @return 错误代码	 */	public String getErrorCode() {		return errorCode;	}	/**	 * @param string 错误代码	 */	public void setErrorCode(String string) {		errorCode = string;	}		/**得到引起例外的Exception	 * @return 引起例外的Exception	 */	public Throwable getCauseException() {		return cause;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?