本文整理汇总了Java中org.sonar.api.batch.sensor.Sensor类的典型用法代码示例。如果您正苦于以下问题:Java Sensor类的具体用法?Java Sensor怎么用?Java Sensor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sensor类属于org.sonar.api.batch.sensor包,在下文中一共展示了Sensor类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.sonar.api.batch.sensor.Sensor; //导入依赖的package包/类
@Override
public void execute() {
for (Sensor sensor : sort(asList(sensors))) {
DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();
sensor.describe(descriptor);
if (sensorOptimizer.shouldExecute(descriptor)) {
executeSensor(context, sensor, descriptor);
}
}
}
示例2: SensorWrapper
import org.sonar.api.batch.sensor.Sensor; //导入依赖的package包/类
public SensorWrapper(Sensor newSensor, SensorContext adaptor, SensorOptimizer optimizer) {
this.wrappedSensor = newSensor;
this.optimizer = optimizer;
descriptor = new DefaultSensorDescriptor();
newSensor.describe(descriptor);
this.adaptor = adaptor;
}
示例3: shouldKeep
import org.sonar.api.batch.sensor.Sensor; //导入依赖的package包/类
private static boolean shouldKeep(Class type, Object extension, @Nullable Project project) {
boolean keep = (ClassUtils.isAssignable(extension.getClass(), type)
|| (org.sonar.api.batch.Sensor.class.equals(type) && ClassUtils.isAssignable(extension.getClass(), Sensor.class)));
if (keep && project != null && ClassUtils.isAssignable(extension.getClass(), CheckProject.class)) {
keep = ((CheckProject) extension).shouldExecuteOnProject(project);
}
return keep;
}
示例4: NewSensorsExecutor
import org.sonar.api.batch.sensor.Sensor; //导入依赖的package包/类
public NewSensorsExecutor(DefaultSensorContext context, SensorOptimizer sensorOptimizer) {
this(context, sensorOptimizer, new Sensor[0]);
}
示例5: executeSensor
import org.sonar.api.batch.sensor.Sensor; //导入依赖的package包/类
private static void executeSensor(SensorContext context, Sensor sensor, DefaultSensorDescriptor descriptor) {
if (LOG.isDebugEnabled()) {
LOG.debug("Execute Sensor: {}", descriptor.name() != null ? descriptor.name() : StringUtils.describe(sensor));
}
sensor.execute(context);
}
示例6: wrappedSensor
import org.sonar.api.batch.sensor.Sensor; //导入依赖的package包/类
public Sensor wrappedSensor() {
return wrappedSensor;
}
示例7: isNotSensor
import org.sonar.api.batch.sensor.Sensor; //导入依赖的package包/类
private static boolean isNotSensor(Object extension) {
return !ExtensionUtils.isType(extension, Sensor.class) && !ExtensionUtils.isType(extension, org.sonar.api.batch.Sensor.class);
}