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()
DefaultSensorDescriptor
createIssuesForRuleRepositories(java.lang.String... repositoryKeys)
List rule repositories thisSensor
create issues for.DefaultSensorDescriptor
createIssuesForRuleRepository(java.lang.String... repositoryKey)
Rule repository thisSensor
create issues for.SensorDescriptor
global()
This sensor should be executed at the project level, instead of per-module.boolean
isGlobal()
java.util.Collection<java.lang.String>
languages()
java.lang.String
name()
DefaultSensorDescriptor
name(java.lang.String name)
Displayable name of theSensor
.DefaultSensorDescriptor
onlyOnFileType(InputFile.Type type)
InputFile.Type
thisSensor
work on.DefaultSensorDescriptor
onlyOnLanguage(java.lang.String languageKey)
Language thisSensor
work on.DefaultSensorDescriptor
onlyOnLanguages(java.lang.String... languageKeys)
List languages thisSensor
work on.SensorDescriptor
onlyWhenConfiguration(java.util.function.Predicate<Configuration> configurationPredicate)
Predicate that will be evaluated on current projectConfiguration
by the platform to decide if execution of theSensor
should be skipped.DefaultSensorDescriptor
requireProperties(java.lang.String... propertyKeys)
List properties thisSensor
depends on.DefaultSensorDescriptor
requireProperty(java.lang.String... propertyKey)
Property thisSensor
depends on.java.util.Collection<java.lang.String>
ruleRepositories()
InputFile.Type
type()
-
-
-
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:SensorDescriptor
Displayable name of theSensor
. Will be displayed in logs.- Specified by:
name
in interfaceSensorDescriptor
-
onlyOnLanguage
public DefaultSensorDescriptor onlyOnLanguage(java.lang.String languageKey)
Description copied from interface:SensorDescriptor
Language thisSensor
work on. Used by the platform to skip execution of theSensor
when no file for given languages are present in the project. Default is to execute sensor for all languages.- Specified by:
onlyOnLanguage
in interfaceSensorDescriptor
-
onlyOnLanguages
public DefaultSensorDescriptor onlyOnLanguages(java.lang.String... languageKeys)
Description copied from interface:SensorDescriptor
List languages thisSensor
work on. Used by the platform to skip execution of theSensor
when no file for given languages are present in the project. Default is to execute sensor for all languages.- Specified by:
onlyOnLanguages
in interfaceSensorDescriptor
-
onlyOnFileType
public DefaultSensorDescriptor onlyOnFileType(InputFile.Type type)
Description copied from interface:SensorDescriptor
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.- Specified by:
onlyOnFileType
in interfaceSensorDescriptor
-
createIssuesForRuleRepository
public DefaultSensorDescriptor createIssuesForRuleRepository(java.lang.String... repositoryKey)
Description copied from interface:SensorDescriptor
Rule repository thisSensor
create issues for. Used by the platform to skip execution of theSensor
when no rule is activated for the given repository.- Specified by:
createIssuesForRuleRepository
in interfaceSensorDescriptor
-
createIssuesForRuleRepositories
public DefaultSensorDescriptor createIssuesForRuleRepositories(java.lang.String... repositoryKeys)
Description copied from interface:SensorDescriptor
List rule repositories thisSensor
create issues for. Used by the platform to skip execution of theSensor
when no rule is activated for the given repositories.- Specified by:
createIssuesForRuleRepositories
in interfaceSensorDescriptor
-
requireProperty
public DefaultSensorDescriptor requireProperty(java.lang.String... propertyKey)
Description copied from interface:SensorDescriptor
Property thisSensor
depends on. Used by the platform to skip execution of theSensor
when property is not set.- Specified by:
requireProperty
in interfaceSensorDescriptor
-
requireProperties
public DefaultSensorDescriptor requireProperties(java.lang.String... propertyKeys)
Description copied from interface:SensorDescriptor
List properties thisSensor
depends on. Used by the platform to skip execution of theSensor
when property is not set.- Specified by:
requireProperties
in interfaceSensorDescriptor
-
global
public SensorDescriptor global()
Description copied from interface:SensorDescriptor
This sensor should be executed at the project level, instead of per-module.- Specified by:
global
in interfaceSensorDescriptor
-
onlyWhenConfiguration
public SensorDescriptor onlyWhenConfiguration(java.util.function.Predicate<Configuration> configurationPredicate)
Description copied from interface:SensorDescriptor
Predicate that will be evaluated on current projectConfiguration
by the platform to decide if execution of theSensor
should be skipped.- Specified by:
onlyWhenConfiguration
in interfaceSensorDescriptor
-
-