Class JVariableDecl
- java.lang.Object
-
- com.inductiveautomation.snap.javatree.JNode
-
- com.inductiveautomation.snap.javatree.JVariableDecl
-
public class JVariableDecl extends JNode
A JNode to represent a defined variable. Found in FieldDeclaration, Method.FormalParameter(s), Block.BlockStatement.LocalVariableDeclaration.
-
-
Field Summary
Fields Modifier and Type Field Description intarrayCountjava.lang.StringarrayInitializerJIdentifieridentifierJExprinitializerJTypetype
-
Constructor Summary
Constructors Constructor Description JVariableDecl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetClassNameImpl()Tries to resolve the class name for this node.java.lang.ClassgetDeclaringClass()Returns the declaring class, if field variable.protected java.lang.StringgetNameImpl()Resolves the name from identifier.java.util.List<JIdentifier>getReferences()Returns a list of references to this variable.protected voidgetReferences(JNode aPart, java.lang.String aName, java.util.List theReferences)Returns a list of references to given name.JVariableDeclgetVariableDeclInside(java.lang.String aName)Returns a variable with given name.-
Methods inherited from class com.inductiveautomation.snap.javatree.JNode
addChild, buildChildren, getBlock, getChild, getChildCount, getChildren, getClassLoader, getClassName, getClassRef, getClassRefImpl, getEnclosingClassDecl, getEnclosingMemberDecl, getEnclosingMethodDecl, getEnd, getEndToken, getFile, getJClass, getLineIndex, getName, getNodeAtCharIndex, getNodeFields, getNodeFieldsImpl, getNodeParents, getNodePath, getNodeString, getOthers, getParent, getParent, getReferencedClasses, getReferencedClassNames, getReferencedClassNames, getReferencedClassNames, getStart, getStartToken, getString, getVariableDecl, getVariableDecls, isBlock, setClassName, setClassRef, setEndToken, setJClass, setParent, setStartToken, toString
-
-
-
-
Field Detail
-
type
public JType type
-
identifier
public JIdentifier identifier
-
arrayCount
public int arrayCount
-
initializer
public JExpr initializer
-
arrayInitializer
public java.lang.String arrayInitializer
-
-
Method Detail
-
getNameImpl
protected java.lang.String getNameImpl()
Resolves the name from identifier.- Overrides:
getNameImplin classJNode
-
getDeclaringClass
public java.lang.Class getDeclaringClass()
Returns the declaring class, if field variable.
-
getClassNameImpl
protected java.lang.String getClassNameImpl()
Tries to resolve the class name for this node.- Overrides:
getClassNameImplin classJNode
-
getReferences
public java.util.List<JIdentifier> getReferences()
Returns a list of references to this variable.
-
getReferences
protected void getReferences(JNode aPart, java.lang.String aName, java.util.List theReferences)
Returns a list of references to given name.
-
getVariableDeclInside
public JVariableDecl getVariableDeclInside(java.lang.String aName)
Returns a variable with given name.- Overrides:
getVariableDeclInsidein classJNode
-
-