JavaDataFlowNode.java
01 /**
02  * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03  */
04 package net.sourceforge.pmd.lang.java.dfa;
05 
06 import java.util.List;
07 
08 import net.sourceforge.pmd.lang.ast.Node;
09 import net.sourceforge.pmd.lang.dfa.AbstractDataFlowNode;
10 import net.sourceforge.pmd.lang.dfa.DataFlowNode;
11 import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration;
12 import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
13 
14 public class JavaDataFlowNode extends AbstractDataFlowNode {
15 
16     public JavaDataFlowNode(List<DataFlowNode> dataFlow, Node node) {
17   super(dataFlow, node);
18     }
19 
20     public String toString() {
21   String res = "DataFlowNode: line " this.getLine() ", ";
22   if (node instanceof ASTMethodDeclaration || node instanceof ASTConstructorDeclaration) {
23       res += (node instanceof ASTMethodDeclaration"(method)" "(constructor)";
24   else {
25       res = super.toString();
26   }
27   return res;
28     }
29 }