org.sonar.api.batch
Class FormulaDecorator

java.lang.Object
  extended by org.sonar.api.batch.FormulaDecorator
All Implemented Interfaces:
CheckProject, Decorator, BatchComponent, BatchExtension, Extension

public class FormulaDecorator
extends java.lang.Object
implements Decorator

A pre-implementation of a decorator using a simple calculation formula

Since:
1.11

Constructor Summary
FormulaDecorator(Metric metric)
          Creates a FormulaDecorator
 
Method Summary
 void decorate(Resource resource, DecoratorContext context)
          
 java.util.List<Metric> dependsUponMetrics()
           
 boolean equals(java.lang.Object o)
           
 Metric generatesMetric()
           
 int hashCode()
           
 boolean shouldExecuteOnProject(Project project)
          
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormulaDecorator

public FormulaDecorator(Metric metric)
Creates a FormulaDecorator

Parameters:
metric - the metric should have an associated formula
Throws:
java.lang.IllegalArgumentException - if no formula is associated to the metric
Method Detail

shouldExecuteOnProject

public boolean shouldExecuteOnProject(Project project)

Specified by:
shouldExecuteOnProject in interface CheckProject

generatesMetric

public Metric generatesMetric()
Returns:
metric generated by the decorator

dependsUponMetrics

public java.util.List<Metric> dependsUponMetrics()
Returns:
metric the decorator depends upon

decorate

public void decorate(Resource resource,
                     DecoratorContext context)

Specified by:
decorate in interface Decorator

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009-2010 SonarSource. All Rights Reserved.