|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jeffpalm.javaparser.SimpleNode
public class SimpleNode
This object is the base class for all items in the AST (abstract syntax tree).
Field Summary | |
---|---|
protected Node[] |
children
Description of the Field |
protected int |
id
Description of the Field |
protected Node |
parent
Description of the Field |
protected JavaParser |
parser
Description of the Field |
java.util.Vector |
specials
Description of the Field |
Constructor Summary | |
---|---|
SimpleNode(int i)
Constructor for the SimpleNode object |
|
SimpleNode(JavaParser parser,
int i)
Constructor for the SimpleNode object |
Method Summary | |
---|---|
void |
addSpecial(java.lang.String key,
Token value)
Description of the Method |
java.lang.Object |
childrenAccept(JavaParserVisitor visitor,
java.lang.Object data)
Accept the visitor. |
void |
dump(java.lang.String prefix)
Dump the node data (including the special tokens) to System.err
Override this method if you want to customize how the node dumps
out its children. |
java.lang.String |
dumpString(java.lang.String prefix)
Dump the node data (including the special tokens) to a String. |
java.util.List |
findChildrenOfType(java.lang.Class targetType)
Description of the Method |
void |
findChildrenOfType(java.lang.Class targetType,
java.util.List results)
Description of the Method |
void |
findChildrenOfType(java.lang.Class targetType,
java.util.List results,
boolean descendIntoNestedClasses)
Description of the Method |
int |
getBeginColumn()
Gets the beginColumn attribute of the SimpleNode object |
int |
getBeginLine()
Gets the beginLine attribute of the SimpleNode object |
int |
getEndColumn()
Gets the endColumn attribute of the SimpleNode object |
int |
getEndLine()
Gets the endLine attribute of the SimpleNode object |
java.lang.String |
getImage()
Gets the image attribute of the SimpleNode object |
java.lang.String |
getName()
Gets the name attribute of the SimpleNode object |
Scope |
getScope()
Gets the scope attribute of the SimpleNode object |
Token |
getSpecial(java.lang.String key)
Gets the special associated with a particular key |
boolean |
hasAnyChildren()
Description of the Method |
protected void |
init()
Initializes any variables that are not required |
boolean |
isRequired()
Is javadoc required? |
java.lang.Object |
jjtAccept(JavaParserVisitor visitor,
java.lang.Object data)
Accept the visitor. |
void |
jjtAddChild(Node n,
int i)
Description of the Method |
void |
jjtAddFirstChild(Node n)
Description of the Method |
void |
jjtClose()
Description of the Method |
void |
jjtDeleteChild(int i)
Remove the node numbered i |
Node |
jjtGetChild(int i)
Description of the Method |
Node |
jjtGetFirstChild()
This method returns a child node. |
int |
jjtGetID()
Return the id for this node |
int |
jjtGetNumChildren()
Description of the Method |
Node |
jjtGetParent()
Description of the Method |
void |
jjtInsertChild(Node n,
int i)
Insert the node numbered i |
void |
jjtOpen()
Description of the Method |
void |
jjtSetParent(Node n)
Description of the Method |
protected java.lang.String |
printModifiers()
Description of the Method |
void |
removeSpecial(java.lang.String key)
Removes a special associated with a key |
void |
setLineAndColumnInfo(int beginLine,
int beginColumn,
int endLine,
int endColumn)
|
void |
setScope(Scope scope)
Sets the scope attribute of the SimpleNode object |
void |
testingOnly__setBeginColumn(int i)
A unit test for JUnit |
void |
testingOnly__setBeginLine(int i)
A unit test for JUnit |
java.lang.String |
toString()
You can override these two methods in subclasses of SimpleNode to customize the way the node appears when the tree is dumped. |
java.lang.String |
toString(java.lang.String prefix)
You can override these two methods in subclasses of SimpleNode to customize the way the node appears when the tree is dumped. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Node parent
protected Node[] children
protected int id
protected JavaParser parser
public java.util.Vector specials
Constructor Detail |
---|
public SimpleNode(int i)
i
- Description of Parameterpublic SimpleNode(JavaParser parser, int i)
parser
- Description of Parameteri
- Description of ParameterMethod Detail |
---|
public void setScope(Scope scope)
scope
- The new scope valuepublic int getBeginLine()
getBeginLine
in interface Node
public int getBeginColumn()
getBeginColumn
in interface Node
public int getEndLine()
getEndLine
in interface Node
public int getEndColumn()
getEndColumn
in interface Node
public Token getSpecial(java.lang.String key)
key
- the key
public boolean isRequired()
public Scope getScope()
public java.lang.String getName()
public java.lang.String getImage()
public void jjtOpen()
jjtOpen
in interface Node
public void jjtClose()
jjtClose
in interface Node
public void setLineAndColumnInfo(int beginLine, int beginColumn, int endLine, int endColumn)
public void testingOnly__setBeginLine(int i)
i
- Description of Parameterpublic void testingOnly__setBeginColumn(int i)
i
- Description of Parameterpublic int jjtGetID()
public void jjtSetParent(Node n)
jjtSetParent
in interface Node
n
- Description of Parameterpublic Node jjtGetParent()
jjtGetParent
in interface Node
public void jjtAddChild(Node n, int i)
jjtAddChild
in interface Node
n
- Description of Parameteri
- Description of Parameterpublic void jjtAddFirstChild(Node n)
jjtAddFirstChild
in interface Node
n
- Description of Parameterpublic void jjtInsertChild(Node n, int i)
jjtInsertChild
in interface Node
n
- Description of Parameteri
- The index of the node to removepublic Node jjtGetChild(int i)
jjtGetChild
in interface Node
i
- Description of Parameter
public Node jjtGetFirstChild()
Same as jjtGetFirstChild();
jjtGetFirstChild
in interface Node
public int jjtGetNumChildren()
jjtGetNumChildren
in interface Node
public boolean hasAnyChildren()
public void jjtDeleteChild(int i)
jjtDeleteChild
in interface Node
i
- The index of the node to removepublic void addSpecial(java.lang.String key, Token value)
key
- Description of Parametervalue
- Description of Parameterpublic void removeSpecial(java.lang.String key)
key
- the special to removepublic java.lang.Object jjtAccept(JavaParserVisitor visitor, java.lang.Object data)
jjtAccept
in interface Node
visitor
- Description of Parameterdata
- Description of Parameter
public java.lang.Object childrenAccept(JavaParserVisitor visitor, java.lang.Object data)
visitor
- Description of Parameterdata
- Description of Parameter
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String prefix)
prefix
- Description of Parameter
public void dump(java.lang.String prefix)
System.err
Override this method if you want to customize how the node dumps
out its children.
prefix
- prefixed to every line of the outputpublic java.lang.String dumpString(java.lang.String prefix)
prefix
- prefixed to every line of the output
public java.util.List findChildrenOfType(java.lang.Class targetType)
targetType
- Description of the Parameter
public void findChildrenOfType(java.lang.Class targetType, java.util.List results)
targetType
- Description of the Parameterresults
- Description of the Parameterpublic void findChildrenOfType(java.lang.Class targetType, java.util.List results, boolean descendIntoNestedClasses)
targetType
- Description of the Parameterresults
- Description of the ParameterdescendIntoNestedClasses
- Description of the Parameterprotected java.lang.String printModifiers()
protected void init()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |