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() |
| boolean | containsChildOfType(Class type)
Finds if this node contains a child of the given type.
|
| void | discardIfNecessary() |
| void | dump(String prefix) |
| protected void | dumpChildren(String prefix) |
| List | findChildNodesWithXPath(String xpathString) |
| List | findChildrenOfType(Class targetType) |
| void | findChildrenOfType(Class targetType, List results) |
| void | findChildrenOfType(Class targetType, List results, boolean descendIntoNestedClasses) |
| int | getBeginColumn() |
| int | getBeginLine() |
| IDataFlowNode | getDataFlowNode() |
| int | getEndColumn() |
| int | getEndLine() |
| Node | getFirstChildOfType(Class childType)
Traverses down the tree to find the first child instance of type childType
|
| Node | getFirstParentOfType(Class parentType)
Traverses up the tree to find the first parent instance of type parentType
|
| String | getImage() |
| Node | getNthParent(int n) |
| List | getParentsOfType(Class parentType)
Traverses up the tree to find all of the parent instances of type parentType
|
| Scope | getScope() |
| void | jjtAddChild(Node n, int i) |
| Node | jjtGetChild(int i) |
| int | jjtGetNumChildren() |
| Node | jjtGetParent() |
| void | jjtReplaceChild(Node old, Node newNode) |
| void | jjtSetParent(Node n) |
| void | setDataFlowNode(IDataFlowNode dataFlowNode) |
| void | setDiscardable() |
| void | setImage(String image) |
| void | setScope(Scope scope) |
| void | setUnDiscardable() |
| 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.