Class ScannerSupplier
java.lang.Object
com.google.errorprone.scanner.ScannerSupplier
public abstract class ScannerSupplier
extends Object
implements com.google.common.base.Supplier<Scanner>
Supplies
Scanners and provides access to the backing sets of all BugCheckers and
enabled BugCheckers.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyOverrides(ErrorProneOptions errorProneOptions) Applies options to thisScannerSupplier.protected abstract com.google.common.collect.ImmutableSet<String> disabled()enabled()filter(com.google.common.base.Predicate<? super BugCheckerInfo> predicate) Filters thisScannerSupplierbased on the provided predicate.static ScannerSupplierfromBugCheckerClasses(Class<? extends BugChecker>... checkerClasses) Returns aScannerSupplierwith a specific list ofBugCheckerclasses.static ScannerSupplierfromBugCheckerClasses(Iterable<Class<? extends BugChecker>> checkers) Returns aScannerSupplierwith a specific list ofBugCheckerclasses.static ScannerSupplierfromBugCheckerInfos(Iterable<BugCheckerInfo> checkers) Returns aScannerSupplierbuilt from a list ofBugCheckerInfos.static ScannerSupplierfromScanner(Scanner scanner) Returns aScannerSupplierthat just returns theScannerthat was passed in.abstract com.google.common.collect.ImmutableBiMap<String, BugCheckerInfo> Returns a map of check name toBugCheckerInfofor allBugCheckerInfos in thisScannerSupplier, including disabled ones.abstract com.google.common.collect.ImmutableSet<BugCheckerInfo> Returns the set ofBugCheckerInfos that are enabled in thisScannerSupplier.abstract ErrorProneFlagsgetFlags()plus(ScannerSupplier other) abstract com.google.common.collect.ImmutableMap<String, BugPattern.SeverityLevel> Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.common.base.Supplier
equals, get
-
Constructor Details
-
ScannerSupplier
public ScannerSupplier()
-
-
Method Details
-
fromBugCheckerClasses
@SafeVarargs public static ScannerSupplier fromBugCheckerClasses(Class<? extends BugChecker>... checkerClasses) Returns aScannerSupplierwith a specific list ofBugCheckerclasses. -
fromBugCheckerClasses
Returns aScannerSupplierwith a specific list ofBugCheckerclasses. -
fromBugCheckerInfos
Returns aScannerSupplierbuilt from a list ofBugCheckerInfos. -
fromScanner
Returns aScannerSupplierthat just returns theScannerthat was passed in. Used mostly for testing. Does not implement any method other thanSupplier.get(). -
getAllChecks
Returns a map of check name toBugCheckerInfofor allBugCheckerInfos in thisScannerSupplier, including disabled ones. -
getEnabledChecks
Returns the set ofBugCheckerInfos that are enabled in thisScannerSupplier. -
severities
public abstract com.google.common.collect.ImmutableMap<String, BugPattern.SeverityLevel> severities() -
disabled
-
enabled
-
getFlags
-
applyOverrides
Applies options to thisScannerSupplier.Command-line options to override check severities may do any of the following:
- Enable a check that is currently off
- Disable a check that is currently on
- Change the severity of a check that is on, promoting a warning to an error or demoting an error to a warning
- Parameters:
errorProneOptions- anErrorProneOptionsobject that encapsulates the overrides for this compilation- Throws:
InvalidCommandLineOptionException- if the override map attempts to disable a check that may not be disabled
-
plus
Composes thisScannerSupplierwith theotherScannerSupplier. The set of checks that are turned on is the intersection of the checks on inthisandother. -
filter
@CheckReturnValue public ScannerSupplier filter(com.google.common.base.Predicate<? super BugCheckerInfo> predicate) Filters thisScannerSupplierbased on the provided predicate. Returns aScannerSupplierwith only the checks enabled that satisfy the predicate.
-