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)
SensorDescriptor
Sensor
. Will be displayed in logs.name
in interface SensorDescriptor
public DefaultSensorDescriptor onlyOnLanguage(String languageKey)
SensorDescriptor
Sensor
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 SensorDescriptor
public DefaultSensorDescriptor onlyOnLanguages(String... languageKeys)
SensorDescriptor
Sensor
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 SensorDescriptor
public DefaultSensorDescriptor onlyOnFileType(InputFile.Type type)
SensorDescriptor
InputFile.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 SensorDescriptor
public DefaultSensorDescriptor createIssuesForRuleRepository(String... repositoryKey)
SensorDescriptor
Sensor
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 SensorDescriptor
public DefaultSensorDescriptor createIssuesForRuleRepositories(String... repositoryKeys)
SensorDescriptor
Sensor
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 SensorDescriptor
public DefaultSensorDescriptor requireProperty(String... propertyKey)
SensorDescriptor
Sensor
depends on. Used by the platform to skip execution of the Sensor
when
property is not set.requireProperty
in interface SensorDescriptor
public DefaultSensorDescriptor requireProperties(String... propertyKeys)
SensorDescriptor
Sensor
depends on. Used by the platform to skip execution of the Sensor
when
property is not set.requireProperties
in interface SensorDescriptor
public SensorDescriptor global()
SensorDescriptor
global
in interface SensorDescriptor
public SensorDescriptor onlyWhenConfiguration(Predicate<Configuration> configurationPredicate)
SensorDescriptor
Configuration
by the platform to decide if execution of the Sensor
should be skipped.onlyWhenConfiguration
in interface SensorDescriptor
Copyright © 2009–2017 SonarSource. All rights reserved.