Package com.google.javascript.jscomp
Class SortingErrorManager
- java.lang.Object
-
- com.google.javascript.jscomp.SortingErrorManager
-
- All Implemented Interfaces:
ErrorHandler
,ErrorManager
- Direct Known Subclasses:
BasicErrorManager
,BlackHoleErrorManager
public class SortingErrorManager extends java.lang.Object implements ErrorManager
A customizable error manager that sorts all errors and warnings reported to it, and has customizable output through theSortingErrorManager.ErrorReportGenerator
interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SortingErrorManager.ErrorReportGenerator
Strategy for customizing the output format of the error report
-
Constructor Summary
Constructors Constructor Description SortingErrorManager(java.util.Set<SortingErrorManager.ErrorReportGenerator> errorReportGenerators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generateReport()
Writes a report to an implementation-specific medium.int
getErrorCount()
Gets the number of reported errors.com.google.common.collect.ImmutableList<JSError>
getErrors()
Gets all the errors.double
getTypedPercent()
Gets the percentage of typed expressions.int
getWarningCount()
Gets the number of reported warnings.com.google.common.collect.ImmutableList<JSError>
getWarnings()
Gets all the warnings.boolean
hasHaltingErrors()
Returns if the error manager has errors that should make compilation halt.void
report(CheckLevel level, JSError error)
Reports an error.void
setTypedPercent(double typedPercent)
Sets the percentage of typed expressions.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.javascript.jscomp.ErrorManager
shouldReportConformanceViolation
-
-
-
-
Constructor Detail
-
SortingErrorManager
public SortingErrorManager(java.util.Set<SortingErrorManager.ErrorReportGenerator> errorReportGenerators)
-
-
Method Detail
-
report
public void report(CheckLevel level, JSError error)
Description copied from interface:ErrorManager
Reports an error. The errors will be displayed by theErrorManager.generateReport()
at the discretion of the implementation.- Specified by:
report
in interfaceErrorHandler
- Specified by:
report
in interfaceErrorManager
- Parameters:
level
- the reporting levelerror
- the error to report
-
hasHaltingErrors
public boolean hasHaltingErrors()
Description copied from interface:ErrorManager
Returns if the error manager has errors that should make compilation halt. This, for example, omits errors that were promoted from warnings by using the --strict flag.- Specified by:
hasHaltingErrors
in interfaceErrorManager
-
getErrorCount
public int getErrorCount()
Description copied from interface:ErrorManager
Gets the number of reported errors.- Specified by:
getErrorCount
in interfaceErrorManager
-
getWarningCount
public int getWarningCount()
Description copied from interface:ErrorManager
Gets the number of reported warnings.- Specified by:
getWarningCount
in interfaceErrorManager
-
getErrors
public com.google.common.collect.ImmutableList<JSError> getErrors()
Description copied from interface:ErrorManager
Gets all the errors.- Specified by:
getErrors
in interfaceErrorManager
-
getWarnings
public com.google.common.collect.ImmutableList<JSError> getWarnings()
Description copied from interface:ErrorManager
Gets all the warnings.- Specified by:
getWarnings
in interfaceErrorManager
-
setTypedPercent
public void setTypedPercent(double typedPercent)
Description copied from interface:ErrorManager
Sets the percentage of typed expressions.- Specified by:
setTypedPercent
in interfaceErrorManager
-
getTypedPercent
public double getTypedPercent()
Description copied from interface:ErrorManager
Gets the percentage of typed expressions.- Specified by:
getTypedPercent
in interfaceErrorManager
-
generateReport
public void generateReport()
Description copied from interface:ErrorManager
Writes 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:
generateReport
in interfaceErrorManager
-
-