Package com.google.javascript.jscomp
Class ThreadSafeDelegatingErrorManager
- java.lang.Object
-
- com.google.javascript.jscomp.ThreadSafeDelegatingErrorManager
-
- All Implemented Interfaces:
ErrorHandler,ErrorManager
public class ThreadSafeDelegatingErrorManager extends java.lang.Object implements ErrorManager
A simple delegatingErrorManagerthat provides a thread-safe wrapper for the one being delegated.
-
-
Constructor Summary
Constructors Constructor Description ThreadSafeDelegatingErrorManager(ErrorManager delegated)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerateReport()Writes a report to an implementation-specific medium.intgetErrorCount()Gets the number of reported errors.com.google.common.collect.ImmutableList<JSError>getErrors()Gets all the errors.doublegetTypedPercent()Gets the percentage of typed expressions.intgetWarningCount()Gets the number of reported warnings.com.google.common.collect.ImmutableList<JSError>getWarnings()Gets all the warnings.booleanhasHaltingErrors()Returns if the error manager has errors that should make compilation halt.voidreport(CheckLevel level, JSError error)Reports an error.voidsetTypedPercent(double typedPercent)Sets the percentage of typed expressions.booleanshouldReportConformanceViolation(Requirement requirement, com.google.common.base.Optional<Requirement.WhitelistEntry> whitelistEntry, JSError diagnostic)Return true if the conformance violation should be reported.
-
-
-
Constructor Detail
-
ThreadSafeDelegatingErrorManager
public ThreadSafeDelegatingErrorManager(ErrorManager delegated)
-
-
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
-
hasHaltingErrors
public boolean hasHaltingErrors()
Description copied from interface:ErrorManagerReturns 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:
hasHaltingErrorsin interfaceErrorManager
-
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 com.google.common.collect.ImmutableList<JSError> getErrors()
Description copied from interface:ErrorManagerGets all the errors.- Specified by:
getErrorsin interfaceErrorManager
-
getWarnings
public com.google.common.collect.ImmutableList<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
-
shouldReportConformanceViolation
public boolean shouldReportConformanceViolation(Requirement requirement, com.google.common.base.Optional<Requirement.WhitelistEntry> whitelistEntry, JSError diagnostic)
Description copied from interface:ErrorManagerReturn true if the conformance violation should be reported. This is called even if the violation is whitelisted.- Specified by:
shouldReportConformanceViolationin interfaceErrorManager
-
-