|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.javascript.jscomp.WarningsGuard
com.google.javascript.jscomp.WhitelistWarningsGuard
public class WhitelistWarningsGuard
An extension of WarningsGuard that provides functionality to maintain
a list of warnings (white-list). It is subclasses' responsibility to decide
what to do with the white-list by implementing the level function.
Warnings are defined by the name of the JS file and the first line of
warnings description.
| Nested Class Summary | |
|---|---|
static class |
WhitelistWarningsGuard.WhitelistBuilder
Whitelist builder |
| Nested classes/interfaces inherited from class com.google.javascript.jscomp.WarningsGuard |
|---|
WarningsGuard.Priority |
| Constructor Summary | |
|---|---|
WhitelistWarningsGuard(Set<String> whitelist)
This class depends on an input set that contains the white-list. |
|
| Method Summary | |
|---|---|
protected boolean |
containWarning(String formattedWarning)
Determines whether a given warning is included in the white-list. |
static String |
formatWarning(JSError error)
|
static String |
formatWarning(JSError error,
boolean withMetaData)
|
static WhitelistWarningsGuard |
fromFile(File file)
Creates a warnings guard from a file. |
static String |
getFirstLine(String warning)
|
int |
getPriority()
The priority in which warnings guards are applied. |
CheckLevel |
level(JSError error)
Returns a new check level for a given error. |
static Set<String> |
loadWhitelistedJsWarnings(File file)
Loads legacy warnings list from the file. |
protected static Set<String> |
loadWhitelistedJsWarnings(com.google.common.io.InputSupplier<? extends Reader> supplier)
Loads legacy warnings list from the file. |
| Methods inherited from class com.google.javascript.jscomp.WarningsGuard |
|---|
disables, enables |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WhitelistWarningsGuard(Set<String> whitelist)
whitelist - The set of JS-warnings that are white-listed. This is
expected to have similar format as formatWarning(JSError).| Method Detail |
|---|
public CheckLevel level(JSError error)
WarningsGuard
level in class WarningsGuarderror - a reported error.
protected boolean containWarning(String formattedWarning)
formattedWarning - the warning formatted by formatWarning
public int getPriority()
WarningsGuard
getPriority in class WarningsGuardpublic static WhitelistWarningsGuard fromFile(File file)
public static Set<String> loadWhitelistedJsWarnings(File file)
protected static Set<String> loadWhitelistedJsWarnings(com.google.common.io.InputSupplier<? extends Reader> supplier)
public static String formatWarning(JSError error)
public static String formatWarning(JSError error,
boolean withMetaData)
withMetaData - If true, include metadata that's useful to humans
This metadata won't be used for matching the warning.public static String getFirstLine(String warning)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||