public class DefaultSensorDescriptor extends Object implements SensorDescriptor
| Constructor and Description |
|---|
DefaultSensorDescriptor() |
| Modifier and Type | Method and Description |
|---|---|
Predicate<Configuration> |
configurationPredicate() |
DefaultSensorDescriptor |
createIssuesForRuleRepositories(String... repositoryKeys)
List rule repositories this
Sensor create issues for. |
DefaultSensorDescriptor |
createIssuesForRuleRepository(String... repositoryKey)
Rule repository this
Sensor create issues for. |
SensorDescriptor |
global()
This sensor should be executed at the project level, instead of per-module.
|
boolean |
isGlobal() |
Collection<String> |
languages() |
String |
name() |
DefaultSensorDescriptor |
name(String name)
Displayable name of the
Sensor. |
DefaultSensorDescriptor |
onlyOnFileType(InputFile.Type type)
InputFile.Type this Sensor work on. |
DefaultSensorDescriptor |
onlyOnLanguage(String languageKey)
Language this
Sensor work on. |
DefaultSensorDescriptor |
onlyOnLanguages(String... languageKeys)
List languages this
Sensor work on. |
SensorDescriptor |
onlyWhenConfiguration(Predicate<Configuration> configurationPredicate)
Predicate that will be evaluated on current module/project
Configuration by the platform to decide if execution of the Sensor should be skipped. |
DefaultSensorDescriptor |
requireProperties(String... propertyKeys)
List properties this
Sensor depends on. |
DefaultSensorDescriptor |
requireProperty(String... propertyKey)
Property this
Sensor depends on. |
Collection<String> |
ruleRepositories() |
InputFile.Type |
type() |
public DefaultSensorDescriptor()
public Collection<String> languages()
@Nullable public InputFile.Type type()
public Collection<String> ruleRepositories()
public Predicate<Configuration> configurationPredicate()
public boolean isGlobal()
public DefaultSensorDescriptor name(String name)
SensorDescriptorSensor. Will be displayed in logs.name in interface SensorDescriptorpublic DefaultSensorDescriptor onlyOnLanguage(String languageKey)
SensorDescriptorSensor work on. Used by the platform to skip execution of the Sensor when
no file for given languages are present in the project.
Default is to execute sensor for all languages.onlyOnLanguage in interface SensorDescriptorpublic DefaultSensorDescriptor onlyOnLanguages(String... languageKeys)
SensorDescriptorSensor work on. Used by the platform to skip execution of the Sensor when
no file for given languages are present in the project.
Default is to execute sensor for all languages.onlyOnLanguages in interface SensorDescriptorpublic DefaultSensorDescriptor onlyOnFileType(InputFile.Type type)
SensorDescriptorInputFile.Type this Sensor work on. Used by the platform to skip execution of the Sensor when
no file for given type are present in the project.
Default is to execute sensor whatever are the available file types.onlyOnFileType in interface SensorDescriptorpublic DefaultSensorDescriptor createIssuesForRuleRepository(String... repositoryKey)
SensorDescriptorSensor create issues for. Used by the platform to skip execution of the Sensor when
no rule is activated for the given repository.createIssuesForRuleRepository in interface SensorDescriptorpublic DefaultSensorDescriptor createIssuesForRuleRepositories(String... repositoryKeys)
SensorDescriptorSensor create issues for. Used by the platform to skip execution of the Sensor when
no rule is activated for the given repositories.createIssuesForRuleRepositories in interface SensorDescriptorpublic DefaultSensorDescriptor requireProperty(String... propertyKey)
SensorDescriptorSensor depends on. Used by the platform to skip execution of the Sensor when
property is not set.requireProperty in interface SensorDescriptorpublic DefaultSensorDescriptor requireProperties(String... propertyKeys)
SensorDescriptorSensor depends on. Used by the platform to skip execution of the Sensor when
property is not set.requireProperties in interface SensorDescriptorpublic SensorDescriptor global()
SensorDescriptorglobal in interface SensorDescriptorpublic SensorDescriptor onlyWhenConfiguration(Predicate<Configuration> configurationPredicate)
SensorDescriptorConfiguration by the platform to decide if execution of the Sensor should be skipped.onlyWhenConfiguration in interface SensorDescriptorCopyright © 2009–2017 SonarSource. All rights reserved.