edu.umd.cs.findbugs
Class ClassScreener

java.lang.Object
  extended by edu.umd.cs.findbugs.ClassScreener

public class ClassScreener
extends java.lang.Object

Class to pre-screen class files, so that only a subset are analyzed. This supports the -onlyAnalyze command line option.

Author:
David Hovemeyer
See Also:
FindBugs

Field Summary
private static boolean DEBUG
           
private  java.util.LinkedList<java.util.regex.Pattern> patternList
           
 
Constructor Summary
ClassScreener()
          Constructor.
 
Method Summary
 void addAllowedClass(java.lang.String className)
          Add the name of a class that should be matched by the screener.
 void addAllowedPackage(java.lang.String packageName)
          Add the name of a package that should be matched by the screener.
 void addAllowedPrefix(java.lang.String prefix)
          Add the name of a package that should be matched by the screener.
 boolean matches(java.lang.String fileName)
          Return whether or not the name of the given file matches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG

patternList

private java.util.LinkedList<java.util.regex.Pattern> patternList
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(java.lang.String className)
Add the name of a class that should be matched by the screener.

Parameters:
className - name of a class that should be matched

addAllowedPackage

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

Parameters:
packageName - name of the package that should be matched

addAllowedPrefix

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

Parameters:
packageName - name of the package that should be matched

matches

public boolean matches(java.lang.String fileName)
Return whether or not the name of the given file matches.