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

📄 exceptionmessage.java

📁 大名鼎鼎的java动态脚本语言。已经通过了sun的认证
💻 JAVA
字号:
package org.codehaus.groovy.control.messages;import java.io.PrintWriter;import org.codehaus.groovy.control.Janitor;import org.codehaus.groovy.control.ProcessingUnit;/** *  A class for error messages produced by the parser system. * *  @author <a href="mailto:cpoirier@dreaming.org">Chris Poirier</a> * *  @version $Id: ExceptionMessage.java,v 1.4 2005/06/09 19:51:59 blackdrag Exp $ */public class ExceptionMessage extends Message{    protected boolean verbose = true;    private Exception cause = null;   // The exception source of the message, if any    ProcessingUnit owner = null;    public ExceptionMessage( Exception cause, boolean v, ProcessingUnit owner )    {        this.verbose = v;        this.cause = cause;        this.owner = owner;    }              /**    *  Returns the underlying Exception.    */    public Exception getCause()    {        return this.cause;    }       /**    *  Writes out a nicely formatted summary of the exception.     */        public void write( PrintWriter output, Janitor janitor )    {        String description = "General error during " + owner.getPhaseDescription() + ": ";                 String message = cause.getMessage();        if( message != null )        {            output.println( description + message );        }        else        {            output.println( description + cause );        }        output.println("");        if (verbose) {            cause.printStackTrace(output);        }    }    }

⌨️ 快捷键说明

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