net.sourceforge.pmd.ast
public abstract class SimpleNode extends Object implements Node
Field Summary | |
---|---|
protected int | beginColumn |
protected int | beginLine |
protected Node[] | children |
protected int | endColumn |
protected int | endLine |
protected int | id |
protected Node | parent |
protected JavaParser | parser |
Constructor Summary | |
---|---|
SimpleNode(int i) | |
SimpleNode(JavaParser p, int i) |
Method Summary | |
---|---|
protected void | appendElement(Node parentNode) |
Document | asXml() |
<T> boolean | containsChildOfType(Class<T> type)
Finds if this node contains a child of the given type.
|
void | dump(String prefix) |
protected void | dumpChildren(String prefix) |
List | findChildNodesWithXPath(String xpathString) |
<T> List<T> | findChildrenOfType(Class<T> targetType) |
<T> void | findChildrenOfType(Class<T> targetType, List<T> results) |
<T> void | findChildrenOfType(Class<T> targetType, List<T> results, boolean descendIntoNestedClasses) |
int | getBeginColumn() |
int | getBeginLine() |
IDataFlowNode | getDataFlowNode() |
int | getEndColumn() |
int | getEndLine() |
<T> T | getFirstChildOfType(Class<T> childType)
Traverses down the tree to find the first child instance of type childType
|
<T> T | getFirstParentOfType(Class<T> parentType)
Traverses up the tree to find the first parent instance of type parentType
|
String | getImage() |
String | getLabel() |
Node | getNthParent(int n) |
<T> List<T> | getParentsOfType(Class<T> parentType)
Traverses up the tree to find all of the parent instances of type parentType
|
Scope | getScope() |
boolean | hasImageEqualTo(String arg) |
void | jjtAddChild(Node n, int i) |
Node | jjtGetChild(int i) |
int | jjtGetNumChildren() |
Node | jjtGetParent() |
void | jjtSetParent(Node n) |
void | setDataFlowNode(IDataFlowNode dataFlowNode) |
void | setImage(String image) |
void | setScope(Scope scope) |
void | testingOnly__setBeginColumn(int i) |
void | testingOnly__setBeginLine(int i) |
String | toString(String prefix) |
Parameters: type the node type to search
Returns: true
if there is at lease on child of the given type and false
in any other case
Parameters: childType class which you want to find.
Returns: Node of type childType. Returns null
if none found.
Parameters: parentType class which you want to find.
Returns: Node of type parentType. Returns null if none found.
Parameters: parentType classes which you want to find.
Returns: List of parentType instances found.