Class JNode
java.lang.Object
com.inductiveautomation.snap.javatree.JNode
- Direct Known Subclasses:
JEnumConstant,JExpr,JFile,JImportDecl,JMemberDecl,JPackageDecl,JStmt,JStmtSwitch.SwitchLabel,JStmtTry.CatchBlock,JType,JTypeParam,JVariableDecl
The base class for all nodes of a JFile.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd child node to list.protected voidInitializes children list by adding children from IVars.getBlock()Returns the statement block.final JNodegetChild(int anIndex) Returns the individual child node at given index.final intReturns the number of child nodes.Returns the array of child nodes.Returns the class loader used to resolve classes.Returns the class name for this node, if it has one.protected StringTries to resolve the class name for this node.Returns the class reference for this node.protected JClassRefReturns the class reference for this node.Returns the enclosing class.Returns the enclosing member declaration, if in member.Returns the enclosing method declaration, if in method.intgetEnd()Returns the end char index of this node.Returns the end token of this node.getFile()Returns the parent file node (root).Returns the Class of this node, if it has one.intReturns the line index of this node.getName()Returns the node name, if it has one.protected StringResolves the name, if possible.getNodeAtCharIndex(int anIndex) Returns the node at given char index.protected Field[]Returns fields for class.protected Field[]Returns fields for this class.Returns the node path.getNodePath(String aSep) Returns the node parent path, with separator.Returns the node name.Returns a list of other nodes that represent the same symbol as this node.Returns the parent node.<T> TReturns the parent node of given class.Returns the list of references for a JClass.Returns the list of references for a JClass.getReferencedClassNames(boolean doClassFilesOnly) Returns the list of references for a JClass.protected voidgetReferencedClassNames(Set aSet, boolean doClassFilesOnly) Loads the list of references for a JNode.intgetStart()Returns the start char index of this node.Returns the start token of this node.final StringReturns the string for this node (from Token.Tokenizer.getInput(Start,End)).getVariableDecl(String aName) Returns a variable with given name.getVariableDeclInside(String aName) Returns a variable inside this node with given name.getVariableDecls(String aPrefix, List<JVariableDecl> theVariables) Fills a given list with variables that start with given prefix.booleanisBlock()Returns whether statement has a block associated with it.protected voidsetClassName(String aName) Sets the class name for this node.protected voidsetClassRef(JClassRef aCRef) Returns the class reference for this node.voidsetEndToken(Token aToken) Sets the end token of this node.protected voidSets the JClassRef of this node from given class.voidSets the parent node.voidsetStartToken(Token aToken) Sets the start token of this node.final StringtoString()Standard toString implementation.
-
Constructor Details
-
JNode
public JNode()
-
-
Method Details
-
getFile
Returns the parent file node (root). -
getName
Returns the node name, if it has one. -
getNameImpl
Resolves the name, if possible. -
getClassLoader
Returns the class loader used to resolve classes. -
getEnclosingClassDecl
Returns the enclosing class. -
getEnclosingMethodDecl
Returns the enclosing method declaration, if in method. -
getEnclosingMemberDecl
Returns the enclosing member declaration, if in member. -
getClassName
Returns the class name for this node, if it has one. -
getClassNameImpl
Tries to resolve the class name for this node. -
setClassName
Sets the class name for this node. -
getClassRef
Returns the class reference for this node. -
getClassRefImpl
Returns the class reference for this node. -
setClassRef
Returns the class reference for this node. -
getJClass
Returns the Class of this node, if it has one. -
setJClass
Sets the JClassRef of this node from given class. -
getStartToken
Returns the start token of this node. -
setStartToken
Sets the start token of this node. -
getStart
public int getStart()Returns the start char index of this node. -
getEndToken
Returns the end token of this node. -
setEndToken
Sets the end token of this node. -
getEnd
public int getEnd()Returns the end char index of this node. -
getLineIndex
public int getLineIndex()Returns the line index of this node. -
getParent
Returns the parent node. -
setParent
Sets the parent node. -
getParent
Returns the parent node of given class. -
getChildCount
public final int getChildCount()Returns the number of child nodes. -
getChild
Returns the individual child node at given index. -
getChildren
Returns the array of child nodes. -
addChild
Add child node to list. -
buildChildren
protected void buildChildren()Initializes children list by adding children from IVars. -
getNodeFields
Returns fields for class. -
getNodeFieldsImpl
Returns fields for this class. -
isBlock
public boolean isBlock()Returns whether statement has a block associated with it. -
getBlock
Returns the statement block. -
getNodeAtCharIndex
Returns the node at given char index. -
getVariableDecl
Returns a variable with given name. -
getVariableDeclInside
Returns a variable inside this node with given name. -
getVariableDecls
Fills a given list with variables that start with given prefix. -
getNodeParents
Returns the node path. -
getNodePath
Returns the node parent path, with separator. -
getNodeString
Returns the node name. -
getReferencedClassNames
Returns the list of references for a JClass. -
getReferencedClassNames
Returns the list of references for a JClass. -
getReferencedClassNames
Loads the list of references for a JNode. -
getReferencedClasses
Returns the list of references for a JClass. -
getOthers
Returns a list of other nodes that represent the same symbol as this node. -
getString
Returns the string for this node (from Token.Tokenizer.getInput(Start,End)). -
toString
Standard toString implementation.
-