|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.javascript.jscomp.WarningsGuard
public abstract class WarningsGuard
Class that allows to flexibly manage what to do with a reported warning/error. Guard has several choices: - return OFF - suppress the warning/error - return WARNING - return ERROR report it with high severity - return null. Does not know what to do with it. Lets the other guard decide what to do with it. Although the interface is very simple it allows you easyly customize what warnings you are interested in. For example there are could be several implementations: StrictGuard - {return ERROR}. All warnings should be treat as errors. SilentGuard - {if (WARNING) return OFF}. Suppress all warnings but still fail if js has errors. WhitelistGuard (if !whitelistErrors.contains(error) return ERROR) return error if it does not present in the whitelist.
Nested Class Summary | |
---|---|
static class |
WarningsGuard.Priority
|
Constructor Summary | |
---|---|
WarningsGuard()
|
Method Summary | |
---|---|
protected boolean |
disables(DiagnosticGroup group)
Returns whether all warnings in the given diagnostic group will be filtered out. |
protected boolean |
enables(DiagnosticGroup group)
Returns whether any of the warnings in the given diagnostic group will be upgraded to a warning or error. |
protected int |
getPriority()
The priority in which warnings guards are applied. |
abstract CheckLevel |
level(JSError error)
Returns a new check level for a given error. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WarningsGuard()
Method Detail |
---|
public abstract CheckLevel level(JSError error)
error
- a reported error.
protected int getPriority()
protected boolean disables(DiagnosticGroup group)
group
- A group of DiagnosticTypes.
protected boolean enables(DiagnosticGroup group)
group
- A group of DiagnosticTypes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |