Package com.google.javascript.jscomp
Class ComposeWarningsGuard
- java.lang.Object
-
- com.google.javascript.jscomp.WarningsGuard
-
- com.google.javascript.jscomp.ComposeWarningsGuard
-
- All Implemented Interfaces:
java.io.Serializable
public final class ComposeWarningsGuard extends WarningsGuard
WarningsGuard that represents just a chain of other guards. For example we could have following chain 1) all warnings outside of /foo/ should be suppressed 2) errors with key JSC_BAR should be marked as warning 3) the rest should be reported as errorThis class is designed for such behavior.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.javascript.jscomp.WarningsGuard
WarningsGuard.Priority
-
-
Constructor Summary
Constructors Constructor Description ComposeWarningsGuard(WarningsGuard... guards)ComposeWarningsGuard(java.util.List<WarningsGuard> guards)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable CheckLevellevel(JSError error)Returns a new check level for a given error.TrimustRunChecks(DiagnosticGroup group)Do checks for `group` still need to be run if this guard is installed? TRUE: Enables one or more types in the group, so it must be checked.java.lang.StringtoString()-
Methods inherited from class com.google.javascript.jscomp.WarningsGuard
getPriority
-
-
-
-
Constructor Detail
-
ComposeWarningsGuard
public ComposeWarningsGuard(java.util.List<WarningsGuard> guards)
-
ComposeWarningsGuard
public ComposeWarningsGuard(WarningsGuard... guards)
-
-
Method Detail
-
level
public @Nullable CheckLevel level(JSError error)
Description copied from class:WarningsGuardReturns a new check level for a given error.`null` means that this guard does not know what to do with the error. `null` can be used it chain multiple guards; if current guard returns null, then the next in the chain should process it.
- Specified by:
levelin classWarningsGuard- Parameters:
error- a reported error.- Returns:
- what level given error should have.
-
mustRunChecks
public Tri mustRunChecks(DiagnosticGroup group)
Description copied from class:WarningsGuardDo checks for `group` still need to be run if this guard is installed?- TRUE: Enables one or more types in the group, so it must be checked.
- FALSE: Disables all types in the group, so it need not be checked.
- UNKNOWN: Does not affect or only partially disables the group, so checking is undecided.
- Overrides:
mustRunChecksin classWarningsGuard- Parameters:
group- a group to check.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-