DaaRuleViolation.java
01 /**
02  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03  */
04 package net.sourceforge.pmd.lang.java.rule.controversial;
05 
06 import net.sourceforge.pmd.Rule;
07 import net.sourceforge.pmd.RuleContext;
08 import net.sourceforge.pmd.lang.ast.Node;
09 import net.sourceforge.pmd.lang.java.ast.JavaNode;
10 import net.sourceforge.pmd.lang.java.rule.JavaRuleViolation;
11 
12 /**
13  * The RuleViolation is extended by the VariableName. The VariableName 
14  * is required for showing what variable produces the UR DD or DU anomaly.
15  *  
16  @author Sven Jacob
17  *
18  */
19 public class DaaRuleViolation extends JavaRuleViolation {
20     private String variableName;
21     private int beginLine;
22     private int endLine;
23     private String type;
24     
25     public DaaRuleViolation(Rule rule, RuleContext ctx, Node node, String type, String msg, String var, int beginLine, int endLine) {
26         super(rule, ctx, (JavaNode)node, msg);
27         this.variableName = var;
28         this.beginLine = beginLine;
29         this.endLine = endLine;
30         this.type = type;
31     }
32   
33     public String getVariableName() {
34         return variableName;
35     }
36   
37     public int getBeginLine() {
38         return beginLine;
39     }
40   
41     public int getEndLine() {
42         return endLine;
43     }
44     
45     public String getType() {
46         return type;
47     }
48 }