org.sonar.api.component
Interface ResourcePerspectives
- All Superinterfaces:
- BatchComponent, Perspectives, ServerComponent
public interface ResourcePerspectives
- extends Perspectives
Use this component to create perspective from resources or InputPath
Only on batch-side.
public class MySensor implements Sensor {
private final ResourcePerspectives perspectives;
public MySensor(ResourcePerspectives perspectives) {
this.perspectives = perspectives;
}
public void analyse(Project module, SensorContext context) {
// Get some Resource or InputFile/InputPath
Highlightable highlightable = perspectives.as(Highlightable.class, inputPath);
if (highlightable != null) {
...
}
}
}
- Since:
- 3.5
- See Also:
Issuable
,
Highlightable
,
Symbolizable
,
Testable
,
TestPlan
Methods inherited from interface org.sonar.api.component.Perspectives |
as |
as
@CheckForNull
<P extends Perspective> P as(Class<P> perspectiveClass,
Resource resource)
as
@CheckForNull
<P extends Perspective> P as(Class<P> perspectiveClass,
InputPath inputPath)
- Allow to create perspective from
InputPath
. In particular from InputFile
.
- Since:
- 4.5.2
Copyright © 2009–2015 SonarSource. All rights reserved.