Package org.codehaus.groovy.tools
Class ErrorReporter
java.lang.Object
org.codehaus.groovy.tools.ErrorReporter
public class ErrorReporter
extends java.lang.Object
Provides services for reporting compilation errors to the
 user.  Primary entry point is 
write().- 
Constructor SummaryConstructors Constructor Description ErrorReporter(java.lang.Throwable e)Configures a new Reporter.ErrorReporter(java.lang.Throwable e, boolean debug)Configures a new Reporter.
- 
Method SummaryModifier and Type Method Description protected voiddispatch(java.lang.Throwable object, boolean child)Runs the report once all initialization is complete.protected voidprintln(java.lang.String line)Prints a line to the underlyingPrintStreamprotected voidprintln(java.lang.StringBuffer line)protected voidreport(java.lang.Exception e, boolean child)For Exception.protected voidreport(java.lang.Throwable e, boolean child)For everything else.protected voidreport(CompilationFailedException e, boolean child)For CompilationFailedException.protected voidreport(GroovyExceptionInterface e, boolean child)For GroovyException.protected voidstacktrace(java.lang.Throwable e, boolean always)Displays an exception's stack trace, ifdebugoralways.voidwrite(java.io.PrintStream stream)Writes the error to the specifiedPrintStream.voidwrite(java.io.PrintWriter writer)Writes the error to the specifiedPrintWriter.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Constructor Details- 
ErrorReporterpublic ErrorReporter(java.lang.Throwable e)Configures a new Reporter. Default mode is not to report a stack trace unless the error was not of one of the supported types.- Parameters:
- e- the exception on which to report
 
- 
ErrorReporterpublic ErrorReporter(java.lang.Throwable e, boolean debug)Configures a new Reporter.- Parameters:
- e- the exception on which to report
- debug- if set, stack traces will be output for all reports
 
 
- 
- 
Method Details- 
writepublic void write(java.io.PrintStream stream)Writes the error to the specifiedPrintStream.
- 
writepublic void write(java.io.PrintWriter writer)Writes the error to the specifiedPrintWriter.
- 
dispatchprotected void dispatch(java.lang.Throwable object, boolean child)Runs the report once all initialization is complete.
- 
reportFor CompilationFailedException.
- 
reportFor GroovyException.
- 
reportprotected void report(java.lang.Exception e, boolean child)For Exception.
- 
reportprotected void report(java.lang.Throwable e, boolean child)For everything else.
- 
printlnprotected void println(java.lang.String line)Prints a line to the underlyingPrintStream
- 
printlnprotected void println(java.lang.StringBuffer line)
- 
stacktraceprotected void stacktrace(java.lang.Throwable e, boolean always)Displays an exception's stack trace, ifdebugoralways.
 
-