Class DefaultSensorDescriptor
- java.lang.Object
-
- org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor
-
- All Implemented Interfaces:
SensorDescriptor
public class DefaultSensorDescriptor extends java.lang.Object implements SensorDescriptor
-
-
Constructor Summary
Constructors Constructor Description DefaultSensorDescriptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.function.Predicate<Configuration>configurationPredicate()DefaultSensorDescriptorcreateIssuesForRuleRepositories(java.lang.String... repositoryKeys)List rule repositories thisSensorcreate issues for.DefaultSensorDescriptorcreateIssuesForRuleRepository(java.lang.String... repositoryKey)Rule repository thisSensorcreate issues for.SensorDescriptorglobal()This sensor should be executed at the project level, instead of per-module.booleanisGlobal()java.util.Collection<java.lang.String>languages()java.lang.Stringname()DefaultSensorDescriptorname(java.lang.String name)Displayable name of theSensor.DefaultSensorDescriptoronlyOnFileType(InputFile.Type type)InputFile.TypethisSensorwork on.DefaultSensorDescriptoronlyOnLanguage(java.lang.String languageKey)Language thisSensorwork on.DefaultSensorDescriptoronlyOnLanguages(java.lang.String... languageKeys)List languages thisSensorwork on.SensorDescriptoronlyWhenConfiguration(java.util.function.Predicate<Configuration> configurationPredicate)Predicate that will be evaluated on current projectConfigurationby the platform to decide if execution of theSensorshould be skipped.DefaultSensorDescriptorrequireProperties(java.lang.String... propertyKeys)List properties thisSensordepends on.DefaultSensorDescriptorrequireProperty(java.lang.String... propertyKey)Property thisSensordepends on.java.util.Collection<java.lang.String>ruleRepositories()InputFile.Typetype()
-
-
-
Method Detail
-
name
public java.lang.String name()
-
languages
public java.util.Collection<java.lang.String> languages()
-
type
@Nullable public InputFile.Type type()
-
ruleRepositories
public java.util.Collection<java.lang.String> ruleRepositories()
-
configurationPredicate
public java.util.function.Predicate<Configuration> configurationPredicate()
-
isGlobal
public boolean isGlobal()
-
name
public DefaultSensorDescriptor name(java.lang.String name)
Description copied from interface:SensorDescriptorDisplayable name of theSensor. Will be displayed in logs.- Specified by:
namein interfaceSensorDescriptor
-
onlyOnLanguage
public DefaultSensorDescriptor onlyOnLanguage(java.lang.String languageKey)
Description copied from interface:SensorDescriptorLanguage thisSensorwork on. Used by the platform to skip execution of theSensorwhen no file for given languages are present in the project. Default is to execute sensor for all languages.- Specified by:
onlyOnLanguagein interfaceSensorDescriptor
-
onlyOnLanguages
public DefaultSensorDescriptor onlyOnLanguages(java.lang.String... languageKeys)
Description copied from interface:SensorDescriptorList languages thisSensorwork on. Used by the platform to skip execution of theSensorwhen no file for given languages are present in the project. Default is to execute sensor for all languages.- Specified by:
onlyOnLanguagesin interfaceSensorDescriptor
-
onlyOnFileType
public DefaultSensorDescriptor onlyOnFileType(InputFile.Type type)
Description copied from interface:SensorDescriptorInputFile.TypethisSensorwork on. Used by the platform to skip execution of theSensorwhen no file for given type are present in the project. Default is to execute sensor whatever are the available file types.- Specified by:
onlyOnFileTypein interfaceSensorDescriptor
-
createIssuesForRuleRepository
public DefaultSensorDescriptor createIssuesForRuleRepository(java.lang.String... repositoryKey)
Description copied from interface:SensorDescriptorRule repository thisSensorcreate issues for. Used by the platform to skip execution of theSensorwhen no rule is activated for the given repository.- Specified by:
createIssuesForRuleRepositoryin interfaceSensorDescriptor
-
createIssuesForRuleRepositories
public DefaultSensorDescriptor createIssuesForRuleRepositories(java.lang.String... repositoryKeys)
Description copied from interface:SensorDescriptorList rule repositories thisSensorcreate issues for. Used by the platform to skip execution of theSensorwhen no rule is activated for the given repositories.- Specified by:
createIssuesForRuleRepositoriesin interfaceSensorDescriptor
-
requireProperty
public DefaultSensorDescriptor requireProperty(java.lang.String... propertyKey)
Description copied from interface:SensorDescriptorProperty thisSensordepends on. Used by the platform to skip execution of theSensorwhen property is not set.- Specified by:
requirePropertyin interfaceSensorDescriptor
-
requireProperties
public DefaultSensorDescriptor requireProperties(java.lang.String... propertyKeys)
Description copied from interface:SensorDescriptorList properties thisSensordepends on. Used by the platform to skip execution of theSensorwhen property is not set.- Specified by:
requirePropertiesin interfaceSensorDescriptor
-
global
public SensorDescriptor global()
Description copied from interface:SensorDescriptorThis sensor should be executed at the project level, instead of per-module.- Specified by:
globalin interfaceSensorDescriptor
-
onlyWhenConfiguration
public SensorDescriptor onlyWhenConfiguration(java.util.function.Predicate<Configuration> configurationPredicate)
Description copied from interface:SensorDescriptorPredicate that will be evaluated on current projectConfigurationby the platform to decide if execution of theSensorshould be skipped.- Specified by:
onlyWhenConfigurationin interfaceSensorDescriptor
-
-