Package org.sonar.java
Class DefaultJavaResourceLocator
- java.lang.Object
-
- org.sonar.java.DefaultJavaResourceLocator
-
- All Implemented Interfaces:
JavaCheck,JavaFileScanner,JavaResourceLocator
public class DefaultJavaResourceLocator extends Object implements JavaResourceLocator
-
-
Constructor Summary
Constructors Constructor Description DefaultJavaResourceLocator(ClasspathForMain javaClasspath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<File>classFilesToAnalyze().class files to be analyzed.Collection<File>classpath()Classpath configured for the project.org.sonar.api.batch.fs.InputFilefindResourceByClassName(String className)Retrieve a SonarQube resource by the class name.voidscanFile(JavaFileScannerContext context)Method called after parsing and semantic analysis has been done on file.
-
-
-
Constructor Detail
-
DefaultJavaResourceLocator
public DefaultJavaResourceLocator(ClasspathForMain javaClasspath)
-
-
Method Detail
-
findResourceByClassName
public org.sonar.api.batch.fs.InputFile findResourceByClassName(String className)
Description copied from interface:JavaResourceLocatorRetrieve a SonarQube resource by the class name.- Specified by:
findResourceByClassNamein interfaceJavaResourceLocator- Parameters:
className- fully qualified name of the analyzed class- Returns:
- null if not found
-
classFilesToAnalyze
public Collection<File> classFilesToAnalyze()
Description copied from interface:JavaResourceLocator.class files to be analyzed. Used by the findbugs plugin.- Specified by:
classFilesToAnalyzein interfaceJavaResourceLocator- Returns:
- a list of .class files corresponding to the source files to be analyzed.
-
classpath
public Collection<File> classpath()
Description copied from interface:JavaResourceLocatorClasspath configured for the project. This classpath method is used by the findbugs plugin to configure the analysis.- Specified by:
classpathin interfaceJavaResourceLocator- Returns:
- the list of jar and class files constituting the classpath of the analyzed project.
-
scanFile
public void scanFile(JavaFileScannerContext context)
Description copied from interface:JavaFileScannerMethod called after parsing and semantic analysis has been done on file.- Specified by:
scanFilein interfaceJavaFileScanner- Parameters:
context- Context of analysis containing the parsed tree.
-
-