org.sonar.api.batch
Class AbstractSumChildrenDecorator

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

public abstract class AbstractSumChildrenDecorator
extends Object
implements Decorator

Sum measures of child resources.

Since:
1.10

Constructor Summary
AbstractSumChildrenDecorator()
           
 
Method Summary
 void decorate(Resource resource, DecoratorContext context)
          
abstract  List<Metric> generatesMetrics()
          Each metric is used individually.
 boolean shouldDecorateResource(Resource resource)
           
 boolean shouldExecuteOnProject(Project project)
          
protected abstract  boolean shouldSaveZeroIfNoChildMeasures()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractSumChildrenDecorator

public AbstractSumChildrenDecorator()
Method Detail

generatesMetrics

public abstract List<Metric> generatesMetrics()
Each metric is used individually. There are as many generated measures than metrics.

Important : annotations are not inherited, so you have to copy the @DependedUpon annotation when implementing this method.

Returns:
not null list of metrics

shouldExecuteOnProject

public boolean shouldExecuteOnProject(Project project)

Specified by:
shouldExecuteOnProject in interface CheckProject

shouldSaveZeroIfNoChildMeasures

protected abstract boolean shouldSaveZeroIfNoChildMeasures()
Returns:
whether it should save zero if no child measures

decorate

public void decorate(Resource resource,
                     DecoratorContext context)

Specified by:
decorate in interface Decorator

shouldDecorateResource

public boolean shouldDecorateResource(Resource resource)
Returns:
whether the resource should be decorated or not

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2011 SonarSource. All Rights Reserved.