View Javadoc

    1   /**
    2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
    3    */
    4   package net.sourceforge.pmd.lang.java.dfa;
    5
    6   import java.util.List;
    7
    8   import net.sourceforge.pmd.lang.ast.Node;
    9   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  }