|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Sensor
A Sensor is invoked once during the analysis of a project. The sensor can invoke a maven plugin, parse a flat file, connect to a web server... For example the Cobertura Sensor invokes the Codehaus Cobertura MOJO. Then the generated XML file is parsed and used to save the first-level of measures on resources (project, package or class).
Sensors are executed first during project analysis. Sensor are generally used to add measure at the lowest level of the resource tree. A sensor can access and save measures on the whole tree of resources.
A particular attention should be given to resource exclusion. Sonar already manages exclusions at file level : if you try to save a measure on a resource that is excluded in the settings, then Sonar will not save the measure. When handling a plugin or an external tool, you should make sure that exclusions are passed if you are going to get back consolidated data.
Field Summary | |
---|---|
static String |
FLAG_SQUID_ANALYSIS
Sensors that depend upon Squid must declare the following method :
|
Method Summary | |
---|---|
void |
analyse(Project project,
SensorContext context)
The method that is going to be run when the sensor is called |
Methods inherited from interface org.sonar.api.batch.CheckProject |
---|
shouldExecuteOnProject |
Field Detail |
---|
static final String FLAG_SQUID_ANALYSIS
- See Also:
- Constant Field Values
Method Detail |
---|
void analyse(Project project, SensorContext context)
project
- the project the sensor runs oncontext
- the context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |