Package edu.umd.cs.findbugs.ba
Class SourceFinder
java.lang.Object
edu.umd.cs.findbugs.ba.SourceFinder
- All Implemented Interfaces:
AutoCloseable
Class to open input streams on source files. It maintains a "source path",
which is like a classpath, but for finding source files instead of class
files.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
findSourceFile
(SourceLineAnnotation source) findSourceFile
(String packageName, String fileName) Open a source file in given package.getBase
(SourceLineAnnotation sourceLineAnnotation) static String
getCanonicalName
(SourceLineAnnotation source) static String
getCanonicalName
(String packageName, String fileName) static String
static String
getPlatformName
(SourceLineAnnotation source) static String
getPlatformName
(String packageName, String fileName) boolean
hasSourceFile
(SourceLineAnnotation source) boolean
hasSourceFile
(String packageName, String fileName) openSource
(SourceLineAnnotation source) openSource
(String packageName, String fileName) Open an input stream on a source file in given package.void
setSourceBaseList
(Iterable<String> sourceBaseList) Set the list of source directories.
-
Constructor Details
-
SourceFinder
-
-
Method Details
-
getProject
- Returns:
- Returns the project.
-
setSourceBaseList
Set the list of source directories. -
openSource
Open an input stream on a source file in given package.- Parameters:
packageName
- the name of the package containing the class whose source file is givenfileName
- the unqualified name of the source file- Returns:
- an InputStream on the source file
- Throws:
IOException
- if a matching source file cannot be found
-
openSource
- Throws:
IOException
-
findSourceFile
- Throws:
IOException
-
findSourceFile
Open a source file in given package.- Parameters:
packageName
- the name of the package containing the class whose source file is givenfileName
- the unqualified name of the source file- Returns:
- the source file
- Throws:
IOException
- if a matching source file cannot be found
-
getPlatformName
-
getPlatformName
-
getCanonicalName
-
getCanonicalName
-
getOrGuessSourceFile
-
hasSourceFile
-
hasSourceFile
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getBase
-
getBase
-