Class JIdentifier


public class JIdentifier extends JExpr
A JExpr subclass for identifiers.
  • Constructor Details

    • JIdentifier

      public JIdentifier()
      Creates a new identifier.
    • JIdentifier

      public JIdentifier(String aName)
      Creates a new identifier for given value.
    • JIdentifier

      public JIdentifier(JType aType)
      Creates a new identifier for given JType: this probably needs to go!
  • Method Details

    • setName

      public void setName(String aName)
      Sets the name for Identifier or Method.
    • getIdentifierType

      public JIdentifier.IdType getIdentifierType()
      Returns the Identifier type: Variable, Field, Class or Package (tries to resolve it if unknown).
    • isVariableId

      public boolean isVariableId()
      Returns whether this is variable identifier.
    • isClassName

      public boolean isClassName()
      Returns whether this is Class identifier.
    • isFieldName

      public boolean isFieldName()
      Returns whether this is ClassField identifier.
    • isMethodName

      public boolean isMethodName()
      Returns whether this identifier is a method name.
    • getMethodCall

      public JMethodCall getMethodCall()
      Returns the method call if parent is method call.
    • getMethodDecl

      public JMethodDecl getMethodDecl()
      Returns the method declaration if parent is method declaration.
    • isPackageName

      public boolean isPackageName()
      Returns whether this is package identifier.
    • getPackageName

      public String getPackageName()
      Returns the full package name for this package identifier.
    • setPackageName

      protected void setPackageName(String aName)
      Returns the full package name for this package identifier.
    • getVariableDecl

      public JVariableDecl getVariableDecl()
      Returns the Identifier variable declaration.
    • setVariableDecl

      public void setVariableDecl(JVariableDecl aVarDecl)
      Sets the Identifier variable declaration.
    • getClassNameImpl

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

      public String getNodeString()
      Returns the part name.
      Overrides:
      getNodeString in class JNode
    • getOthers

      public List<JNode> getOthers()
      Returns a list of other ids for this id.
      Overrides:
      getOthers in class JNode