?? businessexception.java
字號:
package edu.buptsse.sxjd.service;
import java.util.List;
import java.util.ArrayList;
import java.io.PrintStream;
import java.io.PrintWriter;
/**
*本類來源于孫衛(wèi)琴的書,如不明白請請參照該書的講解來理解
* @author sun wei qin
* 2007-1-10
*/
public class BusinessException extends Exception {
protected Throwable rootCause = null;
private List exceptions = new ArrayList();
private String messageKey = null;
private Object[] messageArgs = null;
public BusinessException() {
super();
}
public BusinessException(Throwable rootCause) {
this.rootCause = rootCause;
}
public List getExceptions() {
return exceptions;
}
@SuppressWarnings("unchecked")
public void addException(BusinessException ex) {
exceptions.add(ex);
}
public void setMessageKey(String key) {
this.messageKey = key;
}
public String getMessageKey() {
return messageKey;
}
public void setMessageArgs(Object[] args) {
this.messageArgs = args;
}
public Object[] getMessageArgs() {
return messageArgs;
}
public void setRootCause(Throwable anException) {
rootCause = anException;
}
public Throwable getRootCause() {
return rootCause;
}
public void printStackTrace() {
printStackTrace(System.err);
}
public void printStackTrace(PrintStream outStream) {
printStackTrace(new PrintWriter(outStream));
}
public void printStackTrace(PrintWriter writer) {
super.printStackTrace(writer);
if (getRootCause() != null) {
getRootCause().printStackTrace(writer);
}
writer.flush();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -