org.sonar.plugins.core.rules
Class AbstractRespectJob

java.lang.Object
  extended by org.sonar.plugins.core.rules.AbstractRespectJob
All Implemented Interfaces:
Extension, Job
Direct Known Subclasses:
RespectForMandatoryRulesJob, RespectForOptionalRulesJob, RespectForRulesJob

public abstract class AbstractRespectJob
extends java.lang.Object
implements Job


Constructor Summary
protected AbstractRespectJob()
           
  AbstractRespectJob(org.apache.commons.configuration.Configuration configuration)
           
 
Method Summary
 java.util.List<java.lang.Class<? extends Job>> dependsOnJobs()
          Dependent jobs for the same scope
 java.util.List<Metric> dependsOnMetrics()
          Depends of another measures on the same scope.
 void execute(Resource resource)
           
 java.util.List<Metric> generatesMetrics()
           
protected abstract  Metric getCountMetric()
           
 int getNbLinesForOneError()
           
protected abstract  Metric getRespectMetric()
           
protected  double getValue(java.lang.Double numberOfFailures, java.lang.Double numberOfLines, int nbLinesForOneError)
           
 void setNbLinesForOneError(int nbLinesForOneError)
           
 boolean shouldExecuteOnProject(Resource project)
           
 boolean shouldExecuteOnResource(Resource resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRespectJob

public AbstractRespectJob(org.apache.commons.configuration.Configuration configuration)

AbstractRespectJob

protected AbstractRespectJob()
Method Detail

dependsOnMetrics

public java.util.List<Metric> dependsOnMetrics()
Description copied from interface: Job
Depends of another measures on the same scope.

Specified by:
dependsOnMetrics in interface Job
Returns:
empty list if no dependencies

dependsOnJobs

public java.util.List<java.lang.Class<? extends Job>> dependsOnJobs()
Description copied from interface: Job
Dependent jobs for the same scope

Specified by:
dependsOnJobs in interface Job
Returns:
empty list if no dependencies

generatesMetrics

public java.util.List<Metric> generatesMetrics()
Specified by:
generatesMetrics in interface Job
Returns:
empty list if the job does not calculate measures

shouldExecuteOnProject

public boolean shouldExecuteOnProject(Resource project)
Specified by:
shouldExecuteOnProject in interface Job

shouldExecuteOnResource

public boolean shouldExecuteOnResource(Resource resource)
Specified by:
shouldExecuteOnResource in interface Job

getNbLinesForOneError

public int getNbLinesForOneError()

setNbLinesForOneError

public void setNbLinesForOneError(int nbLinesForOneError)

getCountMetric

protected abstract Metric getCountMetric()

getRespectMetric

protected abstract Metric getRespectMetric()

execute

public void execute(Resource resource)
Specified by:
execute in interface Job

getValue

protected double getValue(java.lang.Double numberOfFailures,
                          java.lang.Double numberOfLines,
                          int nbLinesForOneError)


Copyright © 2008 SonarSource SA. All Rights Reserved.