Package com.google.javascript.jscomp
Class BasicErrorManager
- java.lang.Object
-
- com.google.javascript.jscomp.BasicErrorManager
-
- All Implemented Interfaces:
ErrorHandler,ErrorManager
- Direct Known Subclasses:
AntErrorManager,LoggerErrorManager,PrintStreamErrorManager
public abstract class BasicErrorManager extends java.lang.Object implements ErrorManager
A basic error manager that sorts all errors and warnings reported to it to generate a sorted report when the
generateReport()method is called.This error manager does not produce any output, but subclasses can override the
println(CheckLevel, JSError)method to generate custom output.
-
-
Constructor Summary
Constructors Constructor Description BasicErrorManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidgenerateReport()Writes a report to an implementation-specific medium.intgetErrorCount()Gets the number of reported errors.JSError[]getErrors()Gets all the errors.doublegetTypedPercent()Gets the percentage of typed expressions.intgetWarningCount()Gets the number of reported warnings.JSError[]getWarnings()Gets all the warnings.abstract voidprintln(CheckLevel level, JSError error)Print a message with a trailing new line.protected abstract voidprintSummary()Print the summary of the compilation - number of errors and warnings.voidreport(CheckLevel level, JSError error)Reports an error.voidsetTypedPercent(double typedPercent)Sets the percentage of typed expressions.
-
-
-
Method Detail
-
report
public void report(CheckLevel level, JSError error)
Description copied from interface:ErrorManagerReports an error. The errors will be displayed by theErrorManager.generateReport()at the discretion of the implementation.- Specified by:
reportin interfaceErrorHandler- Specified by:
reportin interfaceErrorManager- Parameters:
level- the reporting levelerror- the error to report
-
generateReport
public void generateReport()
Description copied from interface:ErrorManagerWrites a report to an implementation-specific medium. The compiler calls this method after any and allErrorManager.report(com.google.javascript.jscomp.CheckLevel, com.google.javascript.jscomp.JSError)calls.- Specified by:
generateReportin interfaceErrorManager
-
println
public abstract void println(CheckLevel level, JSError error)
Print a message with a trailing new line. This method is called by thegenerateReport()method when generating messages.
-
printSummary
protected abstract void printSummary()
Print the summary of the compilation - number of errors and warnings.
-
getErrorCount
public int getErrorCount()
Description copied from interface:ErrorManagerGets the number of reported errors.- Specified by:
getErrorCountin interfaceErrorManager
-
getWarningCount
public int getWarningCount()
Description copied from interface:ErrorManagerGets the number of reported warnings.- Specified by:
getWarningCountin interfaceErrorManager
-
getErrors
public JSError[] getErrors()
Description copied from interface:ErrorManagerGets all the errors.- Specified by:
getErrorsin interfaceErrorManager
-
getWarnings
public JSError[] getWarnings()
Description copied from interface:ErrorManagerGets all the warnings.- Specified by:
getWarningsin interfaceErrorManager
-
setTypedPercent
public void setTypedPercent(double typedPercent)
Description copied from interface:ErrorManagerSets the percentage of typed expressions.- Specified by:
setTypedPercentin interfaceErrorManager
-
getTypedPercent
public double getTypedPercent()
Description copied from interface:ErrorManagerGets the percentage of typed expressions.- Specified by:
getTypedPercentin interfaceErrorManager
-
-