org.sonar.batch
Class FormulaDecorator
java.lang.Object
org.sonar.batch.FormulaDecorator
- All Implemented Interfaces:
- CheckProject, Decorator, BatchComponent, BatchExtension, Extension
public final class FormulaDecorator
- extends Object
- implements Decorator
A pre-implementation of a decorator using a simple calculation formula
- Since:
- 1.11
FormulaDecorator
public FormulaDecorator(Metric metric,
Set<Decorator> executeAfterDecorators)
- Creates a FormulaDecorator
- Parameters:
metric
- the metric should have an associated formula
- Throws:
IllegalArgumentException
- if no formula is associated to the metric
FormulaDecorator
public FormulaDecorator(Metric metric)
shouldExecuteOnProject
public boolean shouldExecuteOnProject(Project project)
-
- Specified by:
shouldExecuteOnProject
in interface CheckProject
generatesMetric
public Metric generatesMetric()
- Returns:
- metric generated by the decorator
dependsUponMetrics
public List<Metric> dependsUponMetrics()
- Returns:
- metric the decorator depends upon
dependsUponDecorators
public Collection<Decorator> dependsUponDecorators()
decorate
public void decorate(Resource resource,
DecoratorContext context)
-
- Specified by:
decorate
in interface Decorator
- Parameters:
resource
- resource that is currently decorated, equivalent of context.getResource()
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2009-2012 SonarSource. All Rights Reserved.