Search in sources :

Example 1 with SensorWrapper

use of org.sonar.scanner.sensor.SensorWrapper in project sonarqube by SonarSource.

the class ScannerExtensionDictionnary method evaluatePhase.

private static Phase.Name evaluatePhase(Object extension) {
    Object extensionToEvaluate;
    if (extension instanceof SensorWrapper) {
        extensionToEvaluate = ((SensorWrapper) extension).wrappedSensor();
    } else {
        extensionToEvaluate = extension;
    }
    Phase phaseAnnotation = AnnotationUtils.getAnnotation(extensionToEvaluate, Phase.class);
    if (phaseAnnotation != null) {
        return phaseAnnotation.name();
    }
    return Phase.Name.DEFAULT;
}
Also used : SensorWrapper(org.sonar.scanner.sensor.SensorWrapper) Phase(org.sonar.api.batch.Phase)

Aggregations

Phase (org.sonar.api.batch.Phase)1 SensorWrapper (org.sonar.scanner.sensor.SensorWrapper)1