Package org.sonar.api.batch.sensor
Interface SensorDescriptor
-
public interface SensorDescriptor
Describe what aSensor
is doing. Information may be used by the platform to log interesting information or perform some optimization. SeeSensor.describe(SensorDescriptor)
- Since:
- 5.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description SensorDescriptor
createIssuesForRuleRepositories(java.lang.String... repositoryKeys)
List rule repositories thisSensor
create issues for.SensorDescriptor
createIssuesForRuleRepository(java.lang.String... repositoryKey)
Rule repository thisSensor
create issues for.SensorDescriptor
global()
Deprecated.since 7.6 change yourSensor
to aProjectSensor
insteadSensorDescriptor
name(java.lang.String sensorName)
Displayable name of theSensor
.SensorDescriptor
onlyOnFileType(InputFile.Type type)
InputFile.Type
thisSensor
work on.SensorDescriptor
onlyOnLanguage(java.lang.String languageKey)
Language thisSensor
work on.SensorDescriptor
onlyOnLanguages(java.lang.String... languageKeys)
List languages thisSensor
work on.SensorDescriptor
onlyWhenConfiguration(java.util.function.Predicate<Configuration> predicate)
Predicate that will be evaluated on current projectConfiguration
by the platform to decide if execution of theSensor
should be skipped.
-
-
-
Method Detail
-
name
SensorDescriptor name(java.lang.String sensorName)
Displayable name of theSensor
. Will be displayed in logs.
-
onlyOnLanguage
SensorDescriptor onlyOnLanguage(java.lang.String languageKey)
-
onlyOnLanguages
SensorDescriptor onlyOnLanguages(java.lang.String... languageKeys)
-
onlyOnFileType
SensorDescriptor onlyOnFileType(InputFile.Type type)
InputFile.Type
thisSensor
work on. Used by the platform to skip execution of theSensor
when no file for given type are present in the project. Default is to execute sensor whatever are the available file types.
-
createIssuesForRuleRepository
SensorDescriptor createIssuesForRuleRepository(java.lang.String... repositoryKey)
-
createIssuesForRuleRepositories
SensorDescriptor createIssuesForRuleRepositories(java.lang.String... repositoryKeys)
-
global
@Deprecated SensorDescriptor global()
Deprecated.since 7.6 change yourSensor
to aProjectSensor
insteadThis sensor should be executed at the project level, instead of per-module.- Since:
- 6.4
-
onlyWhenConfiguration
SensorDescriptor onlyWhenConfiguration(java.util.function.Predicate<Configuration> predicate)
Predicate that will be evaluated on current projectConfiguration
by the platform to decide if execution of theSensor
should be skipped.- Since:
- 6.5
-
-