public class JNode
extends java.lang.Object
Constructor and Description |
---|
JNode() |
Modifier and Type | Method and Description |
---|---|
protected void |
addChild(JNode aNode)
Add child node to list.
|
protected void |
buildChildren()
Initializes children list by adding children from IVars.
|
JStmtBlock |
getBlock()
Returns the statement block.
|
JNode |
getChild(int anIndex)
Returns the individual child node at given index.
|
int |
getChildCount()
Returns the number of child nodes.
|
java.util.List<JNode> |
getChildren()
Returns the array of child nodes.
|
WebClassLoader |
getClassLoader()
Returns the class loader used to resolve classes.
|
java.lang.String |
getClassName()
Returns the class name for this node, if it has one.
|
protected java.lang.String |
getClassNameImpl()
Tries to resolve the class name for this node.
|
JClassRef |
getClassRef()
Returns the class reference for this node.
|
protected JClassRef |
getClassRefImpl()
Returns the class reference for this node.
|
JClassDecl |
getEnclosingClassDecl()
Returns the enclosing class.
|
JMemberDecl |
getEnclosingMemberDecl()
Returns the enclosing member declaration, if in member.
|
JMethodDecl |
getEnclosingMethodDecl()
Returns the enclosing method declaration, if in method.
|
int |
getEnd()
Returns the end char index of this node.
|
Token |
getEndToken()
Returns the end token of this node.
|
JFile |
getFile()
Returns the parent file node (root).
|
java.lang.Class |
getJClass()
Returns the Class of this node, if it has one.
|
int |
getLineIndex()
Returns the line index of this node.
|
java.lang.String |
getName()
Returns the node name, if it has one.
|
protected java.lang.String |
getNameImpl()
Resolves the name, if possible.
|
JNode |
getNodeAtCharIndex(int anIndex)
Returns the node at given char index.
|
protected java.lang.reflect.Field[] |
getNodeFields()
Returns fields for class.
|
protected java.lang.reflect.Field[] |
getNodeFieldsImpl()
Returns fields for this class.
|
java.util.List<JNode> |
getNodeParents()
Returns the node path.
|
java.lang.String |
getNodePath(java.lang.String aSep)
Returns the node parent path, with separator.
|
java.lang.String |
getNodeString()
Returns the node name.
|
java.util.List<JNode> |
getOthers()
Returns a list of other nodes that represent the same symbol as this node.
|
JNode |
getParent()
Returns the parent node.
|
<T> T |
getParent(java.lang.Class<T> aClass)
Returns the parent node of given class.
|
java.util.List<java.lang.Class> |
getReferencedClasses()
Returns the list of references for a JClass.
|
java.util.List<java.lang.String> |
getReferencedClassNames()
Returns the list of references for a JClass.
|
java.util.List<java.lang.String> |
getReferencedClassNames(boolean doClassFilesOnly)
Returns the list of references for a JClass.
|
protected void |
getReferencedClassNames(java.util.Set aSet,
boolean doClassFilesOnly)
Loads the list of references for a JNode.
|
int |
getStart()
Returns the start char index of this node.
|
Token |
getStartToken()
Returns the start token of this node.
|
java.lang.String |
getString()
Returns the string for this node (from Token.Tokenizer.getInput(Start,End)).
|
JVariableDecl |
getVariableDecl(java.lang.String aName)
Returns a variable with given name.
|
JVariableDecl |
getVariableDeclInside(java.lang.String aName)
Returns a variable inside this node with given name.
|
java.util.List<JVariableDecl> |
getVariableDecls(java.lang.String aPrefix,
java.util.List<JVariableDecl> theVariables)
Fills a given list with variables that start with given prefix.
|
boolean |
isBlock()
Returns whether statement has a block associated with it.
|
protected void |
setClassName(java.lang.String aName)
Sets the class name for this node.
|
protected void |
setClassRef(JClassRef aCRef)
Returns the class reference for this node.
|
void |
setEndToken(Token aToken)
Sets the end token of this node.
|
protected void |
setJClass(java.lang.Class aClass)
Sets the JClassRef of this node from given class.
|
void |
setParent(JNode aParent)
Sets the parent node.
|
void |
setStartToken(Token aToken)
Sets the start token of this node.
|
java.lang.String |
toString()
Standard toString implementation.
|
public JFile getFile()
public java.lang.String getName()
protected java.lang.String getNameImpl()
public WebClassLoader getClassLoader()
public JClassDecl getEnclosingClassDecl()
public JMethodDecl getEnclosingMethodDecl()
public JMemberDecl getEnclosingMemberDecl()
public java.lang.String getClassName()
protected java.lang.String getClassNameImpl()
protected void setClassName(java.lang.String aName)
public JClassRef getClassRef()
protected JClassRef getClassRefImpl()
protected void setClassRef(JClassRef aCRef)
public java.lang.Class getJClass()
protected void setJClass(java.lang.Class aClass)
public Token getStartToken()
public void setStartToken(Token aToken)
public int getStart()
public Token getEndToken()
public void setEndToken(Token aToken)
public int getEnd()
public int getLineIndex()
public JNode getParent()
public void setParent(JNode aParent)
public <T> T getParent(java.lang.Class<T> aClass)
public final int getChildCount()
public final JNode getChild(int anIndex)
public java.util.List<JNode> getChildren()
protected void addChild(JNode aNode)
protected void buildChildren()
protected java.lang.reflect.Field[] getNodeFields()
protected java.lang.reflect.Field[] getNodeFieldsImpl()
public boolean isBlock()
public JStmtBlock getBlock()
public JNode getNodeAtCharIndex(int anIndex)
public JVariableDecl getVariableDecl(java.lang.String aName)
public JVariableDecl getVariableDeclInside(java.lang.String aName)
public java.util.List<JVariableDecl> getVariableDecls(java.lang.String aPrefix, java.util.List<JVariableDecl> theVariables)
public java.util.List<JNode> getNodeParents()
public java.lang.String getNodePath(java.lang.String aSep)
public java.lang.String getNodeString()
public java.util.List<java.lang.String> getReferencedClassNames()
public java.util.List<java.lang.String> getReferencedClassNames(boolean doClassFilesOnly)
protected void getReferencedClassNames(java.util.Set aSet, boolean doClassFilesOnly)
public java.util.List<java.lang.Class> getReferencedClasses()
public java.util.List<JNode> getOthers()
public final java.lang.String getString()
@Nonnull public final java.lang.String toString()
toString
in class java.lang.Object