Package org.codehaus.groovy.tools
Class ErrorReporter
- java.lang.Object
- 
- org.codehaus.groovy.tools.ErrorReporter
 
- 
 public class ErrorReporter extends java.lang.ObjectProvides services for reporting compilation errors to the user. Primary entry point iswrite().
- 
- 
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 SummaryAll Methods Instance Methods Concrete Methods Modifier 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.
 
- 
- 
- 
Constructor Detail- 
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 Detail- 
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.
 - 
reportprotected void report(CompilationFailedException e, boolean child) For CompilationFailedException.
 - 
reportprotected void report(GroovyExceptionInterface e, boolean child) For 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.
 
- 
 
-