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

📄 exceptionhandler.java

📁 Java 3D Desktop Environment旨在使用Java 3D来创建一个3D桌面环境。功能包括:分布式的应用程序
💻 JAVA
字号:
package org.j3de.exception;

import org.j3de.permission.ExceptionHandlerPermission;

public abstract class ExceptionHandler {
  public static boolean SHOW_WARNING = true;
  public static boolean HIDE_WARNING = false;
  private static ExceptionHandler exceptionHandler = null;

  public ExceptionHandler() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
       sm.checkPermission(new ExceptionHandlerPermission("instantiate"));
    }

    exceptionHandler = this;
  }

  protected abstract void handleExceptionImpl(Exception e);

  public static void handleException(Exception e) {
    if (exceptionHandler == null)
      exceptionHandler = new DefaultExceptionHandler();

    exceptionHandler.handleExceptionImpl(e);
  }

  protected abstract void handleFatalExceptionImpl(Exception e);

  public static void handleFatalException(Exception e) {
    if (exceptionHandler == null)
      exceptionHandler = new DefaultExceptionHandler();

    exceptionHandler.handleFatalExceptionImpl(e);
  }      
  
  protected abstract void handleWarningImpl(String msg);

  public static void handleWarning(String msg) {
    if (exceptionHandler == null)
      exceptionHandler = new DefaultExceptionHandler();

    exceptionHandler.handleWarningImpl(msg);    
  }

}

⌨️ 快捷键说明

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