Class FixingErrorManager
- java.lang.Object
-
- com.google.javascript.jscomp.SortingErrorManager
-
- com.google.javascript.jscomp.BasicErrorManager
-
- com.google.javascript.refactoring.FixingErrorManager
-
- All Implemented Interfaces:
ErrorHandler
,ErrorManager
public class FixingErrorManager extends BasicErrorManager
An error manager that finds a SuggestedFix for all errors if possible.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.javascript.jscomp.SortingErrorManager
SortingErrorManager.ErrorReportGenerator
-
-
Constructor Summary
Constructors Constructor Description FixingErrorManager()
FixingErrorManager(com.google.common.collect.ImmutableSet<DiagnosticType> unfixableErrors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<SuggestedFix>
getAllFixes()
Returns fixes for errors first, then fixes for warnings.java.util.List<SuggestedFix>
getFixesForJsError(JSError error)
java.util.Collection<SuggestedFix>
getSureFixes()
Returns fixes for errors and warnings that only have one 'sure' guaranteed fix.void
println(CheckLevel level, JSError error)
Print a message with a trailing new line.void
printSummary()
Print the summary of the compilation - number of errors and warnings.void
report(CheckLevel level, JSError error)
Reports an error.void
setCompiler(AbstractCompiler compiler)
-
Methods inherited from class com.google.javascript.jscomp.BasicErrorManager
generateReport
-
Methods inherited from class com.google.javascript.jscomp.SortingErrorManager
getErrorCount, getErrors, getTypedPercent, getWarningCount, getWarnings, hasHaltingErrors, setTypedPercent
-
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
-
FixingErrorManager
public FixingErrorManager()
-
FixingErrorManager
public FixingErrorManager(com.google.common.collect.ImmutableSet<DiagnosticType> unfixableErrors)
-
-
Method Detail
-
setCompiler
public void setCompiler(AbstractCompiler compiler)
-
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
- Overrides:
report
in classSortingErrorManager
- Parameters:
level
- the reporting levelerror
- the error to report
-
getFixesForJsError
public java.util.List<SuggestedFix> getFixesForJsError(JSError error)
-
getSureFixes
public java.util.Collection<SuggestedFix> getSureFixes()
Returns fixes for errors and warnings that only have one 'sure' guaranteed fix.
-
getAllFixes
public java.util.Collection<SuggestedFix> getAllFixes()
Returns fixes for errors first, then fixes for warnings. This includes 'sure' fixes with only one option, and 'multi' fixes which have multiple choices.
-
printSummary
public void printSummary()
Description copied from class:BasicErrorManager
Print the summary of the compilation - number of errors and warnings.- Specified by:
printSummary
in classBasicErrorManager
-
println
public void println(CheckLevel level, JSError error)
Description copied from class:BasicErrorManager
Print a message with a trailing new line. This method is called by theBasicErrorManager.generateReport()
method when generating messages.- Specified by:
println
in classBasicErrorManager
-
-