|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Issuable
This perspective allows to add and get issues related to the selected component. It can be used from
Sensors and Decorators. Web extensions
must use RubyIssueService.
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);
}
}
}
| Nested Class Summary | |
|---|---|
static interface |
Issuable.IssueBuilder
|
| Method Summary | |
|---|---|
boolean |
addIssue(Issue issue)
Register an issue created with newIssueBuilder(). |
List<Issue> |
issues()
Unresolved issues, including the issues reported by end-users. |
Issuable.IssueBuilder |
newIssueBuilder()
Builder is used to create the issue to be passed to addIssue(Issue) |
List<Issue> |
resolvedIssues()
Issues marked as resolved during this scan. |
| Methods inherited from interface org.sonar.api.component.Perspective |
|---|
component |
| Method Detail |
|---|
Issuable.IssueBuilder newIssueBuilder()
addIssue(Issue)
boolean addIssue(Issue issue)
newIssueBuilder().
This method is usually called from Sensors. Decorators calling this
method must be annotated with @DependedUpon(DecoratorBarriers.ISSUES_ADDED).
List<Issue> issues()
Decorators calling this method must be annotated with @DependsUpon(DecoratorBarriers.ISSUES_TRACKED).
List<Issue> resolvedIssues()
Decorators calling this method must be annotated with @DependsUpon(DecoratorBarriers.ISSUES_TRACKED).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||