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 SummaryConstructors
- 
Method SummaryModifier 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- 
JNodepublic JNode()
 
- 
- 
Method Details- 
getFileReturns the parent file node (root).
- 
getNameReturns the node name, if it has one.
- 
getNameImplResolves the name, if possible.
- 
getClassLoaderReturns the class loader used to resolve classes.
- 
getEnclosingClassDeclReturns the enclosing class.
- 
getEnclosingMethodDeclReturns the enclosing method declaration, if in method.
- 
getEnclosingMemberDeclReturns the enclosing member declaration, if in member.
- 
getClassNameReturns the class name for this node, if it has one.
- 
getClassNameImplTries to resolve the class name for this node.
- 
setClassNameSets the class name for this node.
- 
getClassRefReturns the class reference for this node.
- 
getClassRefImplReturns the class reference for this node.
- 
setClassRefReturns the class reference for this node.
- 
getJClassReturns the Class of this node, if it has one.
- 
setJClassSets the JClassRef of this node from given class.
- 
getStartTokenReturns the start token of this node.
- 
setStartTokenSets the start token of this node.
- 
getStartpublic int getStart()Returns the start char index of this node.
- 
getEndTokenReturns the end token of this node.
- 
setEndTokenSets the end token of this node.
- 
getEndpublic int getEnd()Returns the end char index of this node.
- 
getLineIndexpublic int getLineIndex()Returns the line index of this node.
- 
getParentReturns the parent node.
- 
setParentSets the parent node.
- 
getParentReturns the parent node of given class.
- 
getChildCountpublic final int getChildCount()Returns the number of child nodes.
- 
getChildReturns the individual child node at given index.
- 
getChildrenReturns the array of child nodes.
- 
addChildAdd child node to list.
- 
buildChildrenprotected void buildChildren()Initializes children list by adding children from IVars.
- 
getNodeFieldsReturns fields for class.
- 
getNodeFieldsImplReturns fields for this class.
- 
isBlockpublic boolean isBlock()Returns whether statement has a block associated with it.
- 
getBlockReturns the statement block.
- 
getNodeAtCharIndexReturns the node at given char index.
- 
getVariableDeclReturns a variable with given name.
- 
getVariableDeclInsideReturns a variable inside this node with given name.
- 
getVariableDeclsFills a given list with variables that start with given prefix.
- 
getNodeParentsReturns the node path.
- 
getNodePathReturns the node parent path, with separator.
- 
getNodeStringReturns the node name.
- 
getReferencedClassNamesReturns the list of references for a JClass.
- 
getReferencedClassNamesReturns the list of references for a JClass.
- 
getReferencedClassNamesLoads the list of references for a JNode.
- 
getReferencedClassesReturns the list of references for a JClass.
- 
getOthersReturns a list of other nodes that represent the same symbol as this node.
- 
getStringReturns the string for this node (from Token.Tokenizer.getInput(Start,End)).
- 
toStringStandard toString implementation.
 
-