edu.umd.cs.findbugs

Class ClassScreener

public class ClassScreener extends Object implements IClassScreener

Class to pre-screen class files, so that only a subset are analyzed. This supports the -onlyAnalyze command line option. Modified February 2006 in four ways: a) don't break windows platform by hard-coding '/' as the directory separator b) store list of Matchers, not Patterns, so we don't keep instantiating Matchers c) fix suffix bug, so FooBar and Foo$Bar no longer match Bar d) addAllowedPackage() can now handle unicode chars in filenames, though we still may not be handling every case mentioned in section 7.2.1 of the JLS

Author: David Hovemeyer

See Also: FindBugs

Constructor Summary
ClassScreener()
Constructor.
Method Summary
voidaddAllowedClass(String className)
Add the name of a class to be matched by the screener.
voidaddAllowedPackage(String packageName)
Add the name of a package to be matched by the screener.
voidaddAllowedPrefix(String prefix)
Add the name of a prefix to be matched by the screener.
booleanmatches(String fileName)

Constructor Detail

ClassScreener

public ClassScreener()
Constructor. By default, the ClassScreener will match all class files. Once addAllowedClass() and addAllowedPackage() are called, the ClassScreener will only match the explicitly specified classes and packages.

Method Detail

addAllowedClass

public void addAllowedClass(String className)
Add the name of a class to be matched by the screener.

Parameters: className name of a class to be matched

addAllowedPackage

public void addAllowedPackage(String packageName)
Add the name of a package to be matched by the screener. All class files that appear to be in the package should be matched.

Parameters: packageName name of the package to be matched

addAllowedPrefix

public void addAllowedPrefix(String prefix)
Add the name of a prefix to be matched by the screener. All class files that appear to be in the package specified by the prefix, or a more deeply nested package, should be matched.

Parameters: prefix name of the prefix to be matched

matches

public boolean matches(String fileName)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.