Created
July 2, 2014 21:58
-
-
Save simonbrandhof/cb1006435ae086d4e264 to your computer and use it in GitHub Desktop.
Issuable on directories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.sonar.api.component.ResourcePerspectives; | |
public class MySensor implements Sensor { | |
private final ResourcePerspectives perspectives; | |
public MySensor(ResourcePerspectives perspectives) { | |
this.perspectives = perspectives; | |
} | |
@Override | |
public void analyse(Project project, SensorContext context) { | |
Directory dir = Directory.create("src/main/java/foo"); | |
Issuable issuable = perspectives.as(Issuable.class, dir); | |
if (issuable != null) { | |
// ... | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment