public final class ByPathWarningsGuard extends WarningsGuard
WarningsGuard that can modify the
CheckLevel based on the file that caused the warning, and whether
this file matches a set of paths (specified either as include or exclude
of path name parts).
For example:
List<String> paths = new ArrayList<String>();
paths.add("foo");
WarningsGuard guard =
ByPathWarningsGuard.forPath(paths, CheckLevel.ERROR, 1);
This guard will convert any warning that came from a file that contains "foo"
in its path to an error.WarningsGuard.Priority| Modifier and Type | Method and Description |
|---|---|
static ByPathWarningsGuard |
exceptPath(java.util.List<java.lang.String> paths,
CheckLevel level) |
static ByPathWarningsGuard |
forPath(java.util.List<java.lang.String> paths,
CheckLevel level) |
protected int |
getPriority()
The priority in which warnings guards are applied.
|
CheckLevel |
level(JSError error)
Returns a new check level for a given error.
|
disables, enables, makeNonStrictpublic static ByPathWarningsGuard forPath(java.util.List<java.lang.String> paths, CheckLevel level)
paths - Paths for matching.level - The CheckLevel to apply on affected files.ByPathWarningsGuard that would affect any file in the
given set of paths.public static ByPathWarningsGuard exceptPath(java.util.List<java.lang.String> paths, CheckLevel level)
paths - Paths for matching.level - The CheckLevel to apply on affected files.ByPathWarningsGuard that would affect any file not
in the given set of paths.public CheckLevel level(JSError error)
WarningsGuardlevel in class WarningsGuarderror - a reported error.protected int getPriority()
WarningsGuardgetPriority in class WarningsGuardCopyright © 2009-2019 Google. All Rights Reserved.