Class DiscoverSourceDirectories
java.lang.Object
edu.umd.cs.findbugs.DiscoverSourceDirectories
Based on the contents of the application directories/archives in a Project,
and a "root" source directory (under which some number of "real" source
directories may be located), scan to find the source directories containing
the application's source files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classstatic interfaceProgress callback interface for reporting the progress of source directory discovery. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanprivate IErrorLoggerprivate Projectprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate IClassPathbuildClassPath(IClassPathBuilder builder, IClassFactory factory) voidexecute()Execute the search for source directories.private StringfindFullyQualifiedSourceFileName(IClassPath classPath, ClassDescriptor classDesc) findFullyQualifiedSourceFileNames(IClassPathBuilder builder, IClassPath classPath) private voidfindSourceDirectoriesForAllSourceFiles(List<String> fullyQualifiedSourceFileNameList, List<String> candidateSourceDirList) Get the list of discovered source directories.static voidJust for testing.voidsetErrorLogger(IErrorLogger errorLogger) Set the error logger to use to report errors during scanning.voidSet the progress callback to which scanning progress should be reported.voidsetProject(Project project) Set the Project for which we want to find source directories.voidsetRootSourceDirectory(String rootSourceDirectory) Set the "root" source directory: we expect all of the actual source directories to be underneath it.
-
Field Details
-
DEBUG
private static boolean DEBUG -
project
-
rootSourceDirectory
-
errorLogger
-
progress
-
discoveredSourceDirectoryList
-
-
Constructor Details
-
DiscoverSourceDirectories
public DiscoverSourceDirectories()Constructor.
-
-
Method Details
-
setProject
Set the Project for which we want to find source directories.- Parameters:
project- Project for which we want to find source directories
-
setRootSourceDirectory
Set the "root" source directory: we expect all of the actual source directories to be underneath it.- Parameters:
rootSourceDirectory- the root source directory
-
setErrorLogger
Set the error logger to use to report errors during scanning. By default, a no-op error logger is used.- Parameters:
errorLogger- error logger to use to report errors during scanning
-
setProgress
Set the progress callback to which scanning progress should be reported.- Parameters:
progress- the progress callback
-
getDiscoveredSourceDirectoryList
-
execute
Execute the search for source directories. -
buildClassPath
private IClassPath buildClassPath(IClassPathBuilder builder, IClassFactory factory) throws InterruptedException, IOException, CheckedAnalysisException -
findFullyQualifiedSourceFileName
private String findFullyQualifiedSourceFileName(IClassPath classPath, ClassDescriptor classDesc) throws IOException, CheckedAnalysisException - Throws:
IOExceptionCheckedAnalysisException
-
findFullyQualifiedSourceFileNames
private List<String> findFullyQualifiedSourceFileNames(IClassPathBuilder builder, IClassPath classPath) -
findSourceDirectoriesForAllSourceFiles
-
main
public static void main(String[] args) throws IOException, CheckedAnalysisException, InterruptedException Just for testing.
-