public interface Issuable extends Perspective
Sensors.
 
   import org.sonar.api.component.ResourcePerspectives;
   public class MySensor extends Sensor {
     private final ResourcePerspectives perspectives;
     public MySensor(ResourcePerspectives p) {
       this.perspectives = p;
     }
     public void analyse(Project project, SensorContext context) {
       Resource myResource; // to be set
       Issuable issuable = perspectives.as(Issuable.class, myResource);
       if (issuable != null) {
         // can be used
         Issue issue = issuable.newIssueBuilder()
           .setRuleKey(RuleKey.of("pmd", "AvoidArrayLoops")
           .setLine(10)
           .build();
         issuable.addIssue(issue);
       }
     }
   }
 | Modifier and Type | Interface and Description | 
|---|---|
| static interface  | Issuable.IssueBuilder | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | addIssue(Issue issue)Register an issue created with  newIssueBuilder(). | 
| List<Issue> | issues()Deprecated. 
 since 5.2 no more decorators on batch side | 
| Issuable.IssueBuilder | newIssueBuilder()Builder is used to create the issue to be passed to  addIssue(Issue) | 
| List<Issue> | resolvedIssues()Deprecated. 
 since 5.2 no more decorators on batch side | 
Issuable.IssueBuilder newIssueBuilder()
addIssue(Issue)boolean addIssue(Issue issue)
newIssueBuilder().
 Sensors. Decorators calling this
 method must be annotated with @DependedUpon(DecoratorBarriers.ISSUES_ADDED).@Deprecated List<Issue> issues()
@Deprecated List<Issue> resolvedIssues()
Copyright © 2009–2016 SonarSource. All rights reserved.