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 Details

    • type

      public JType type
    • identifier

      public JIdentifier identifier
    • arrayCount

      public int arrayCount
    • initializer

      public JExpr initializer
    • arrayInitializer

      public String arrayInitializer
  • Constructor Details

    • JVariableDecl

      public JVariableDecl()
  • Method Details

    • getNameImpl

      protected String getNameImpl()
      Resolves the name from identifier.
      Overrides:
      getNameImpl in class JNode
    • getDeclaringClass

      public Class getDeclaringClass()
      Returns the declaring class, if field variable.
    • getClassNameImpl

      protected String getClassNameImpl()
      Tries to resolve the class name for this node.
      Overrides:
      getClassNameImpl in class JNode
    • getReferences

      public List<JIdentifier> getReferences()
      Returns a list of references to this variable.
    • getReferences

      protected void getReferences(JNode aPart, String aName, List theReferences)
      Returns a list of references to given name.
    • getVariableDeclInside

      public JVariableDecl getVariableDeclInside(String aName)
      Returns a variable with given name.
      Overrides:
      getVariableDeclInside in class JNode