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, makeNonStrict
public 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)
WarningsGuard
level
in class WarningsGuard
error
- a reported error.protected int getPriority()
WarningsGuard
getPriority
in class WarningsGuard
Copyright © 2009-2020 Google. All Rights Reserved.