⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phsexception.java

📁 JAVA实现的短信网关程序
💻 JAVA
字号:
package sms.PHS;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */
import java.io.PrintStream;

public class PHSException
    extends Exception {

  public PHSException(Exception e, String message, boolean fatal) {
    this(e, message);
    setFatal(fatal);
  }

  public PHSException(Exception e, String message) {
    super(message);
    exception = e;
  }

  public PHSException(Exception e) {
    this(e, e.getMessage());
  }

  public PHSException(String message) {
    super(message);
  }

  public PHSException() {
  }

  public boolean isFatal() {
    return fatal;
  }

  public void printStackTrace(PrintStream printStream) {
    super.printStackTrace(printStream);
    if (exception != null) {
      System.out.print("%%%% wrapped exception: ");
      exception.printStackTrace(printStream);
    }
  }

  public void printStackTrace() {
    super.printStackTrace();
    if (exception != null) {
      System.out.print("%%%% wrapped exception: ");
      exception.printStackTrace();
    }
  }

  public void setFatal(boolean fatal) {
    this.fatal = fatal;
  }

  public String toString() {
    if (exception != null) {
      return super.toString() + " wraps: [" + exception.toString() + "]";
    }
    else {
      return super.toString();
    }
  }

  protected Exception exception;
  protected boolean fatal;
}

⌨️ 快捷键说明

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