01 package net.sourceforge.pmd.lang.java.rule;
02
03 import java.util.List;
04
05 import net.sourceforge.pmd.RuleContext;
06 import net.sourceforge.pmd.lang.ast.Node;
07 import net.sourceforge.pmd.lang.rule.stat.StatisticalRule;
08 import net.sourceforge.pmd.lang.rule.stat.StatisticalRuleHelper;
09 import net.sourceforge.pmd.stat.DataPoint;
10
11 public abstract class AbstractStatisticalJavaRule extends AbstractJavaRule implements StatisticalRule {
12
13 private final StatisticalRuleHelper helper = new StatisticalRuleHelper(this);
14
15 public void addDataPoint(DataPoint point) {
16 helper.addDataPoint(point);
17 }
18
19 public Object[] getViolationParameters(DataPoint point) {
20 return null;
21 }
22
23 @Override
24 public void apply(List<? extends Node> nodes, RuleContext ctx) {
25 super.apply(nodes, ctx);
26 helper.apply(ctx);
27 }
28 }
|