public class DefaultJavaResourceLocator extends Object implements JavaResourceLocator
Constructor and Description |
---|
DefaultJavaResourceLocator(org.sonar.api.batch.fs.FileSystem fs,
JavaClasspath javaClasspath) |
Modifier and Type | Method and Description |
---|---|
Collection<File> |
classFilesToAnalyze()
.class files to be analyzed.
|
Collection<String> |
classKeys()
fully qualified names of the classes to be analyzed by sonar java analyzer.
|
Collection<File> |
classpath()
Classpath configured for the project.
|
org.sonar.api.batch.fs.InputFile |
findResourceByClassName(String className)
Retrieve a SonarQube resource by the class name.
|
String |
findSourceFileKeyByClassName(String className)
get source file key by class name.
|
Integer |
getMethodStartLine(String fullyQualifiedMethodName)
Get the first line of a method definition.
|
void |
scanFile(JavaFileScannerContext context)
Method called after parsing and semantic analysis has been done on file.
|
void |
setSensorContext(org.sonar.api.batch.sensor.SensorContext sensorContext) |
public DefaultJavaResourceLocator(org.sonar.api.batch.fs.FileSystem fs, JavaClasspath javaClasspath)
public void setSensorContext(org.sonar.api.batch.sensor.SensorContext sensorContext)
public org.sonar.api.batch.fs.InputFile findResourceByClassName(String className)
JavaResourceLocator
findResourceByClassName
in interface JavaResourceLocator
className
- fully qualified name of the analyzed classpublic String findSourceFileKeyByClassName(String className)
JavaResourceLocator
findSourceFileKeyByClassName
in interface JavaResourceLocator
className
- fully qualified name of the analyzed class.public Collection<String> classKeys()
JavaResourceLocator
classKeys
in interface JavaResourceLocator
public Collection<File> classFilesToAnalyze()
JavaResourceLocator
classFilesToAnalyze
in interface JavaResourceLocator
public Collection<File> classpath()
JavaResourceLocator
classpath
in interface JavaResourceLocator
public Integer getMethodStartLine(String fullyQualifiedMethodName)
JavaResourceLocator
getMethodStartLine
in interface JavaResourceLocator
fullyQualifiedMethodName
- the full name of the method.public void scanFile(JavaFileScannerContext context)
JavaFileScanner
scanFile
in interface JavaFileScanner
context
- Context of analysis containing the parsed tree.Copyright © 2012–2016 SonarSource. All rights reserved.