public interface ResourcePerspectives extends Perspectives
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) { ... } } }
Issuable
,
Highlightable
,
Symbolizable
,
Testable
,
TestPlan
Modifier and Type | Method and Description |
---|---|
<P extends Perspective> |
as(Class<P> perspectiveClass,
InputPath inputPath)
Allow to create perspective from
InputPath . |
<P extends Perspective> |
as(Class<P> perspectiveClass,
Resource resource) |
as
@CheckForNull <P extends Perspective> P as(Class<P> perspectiveClass, Resource resource)
@CheckForNull <P extends Perspective> P as(Class<P> perspectiveClass, InputPath inputPath)
Copyright © 2009–2015 SonarSource. All rights reserved.