Interface IJavaIdentifier

All Superinterfaces:
IJavaElement, IJavaExpression, IJavaLeftExpression

@Ser public interface IJavaIdentifier extends IJavaLeftExpression
Java AST interface to represent a Java identifier, or variable.

Example:

 int someVariable = 3;
     ^^^^^^^^^^^^
 
  • Method Details

    • getDefinition

      IJavaDefinition getDefinition()
      Get this identifier's definition statement.
      Returns:
    • getType

      IJavaType getType()
      Get this identifier's type.
      Returns:
    • getName

      String getName()
      Get the identifier original name.

      In order to retrieve the current (effective) name, use IJavaSourceUnit#getIdentifierName(IJavaIdentifier).

      Returns:
      the original (not necessarily current) name, never null
    • getDebugName

      String getDebugName()
      Get the identifier's debug name, if any was provided.

      In order to retrieve the current (effective) name, use IJavaSourceUnit#getIdentifierName(IJavaIdentifier).

      Returns:
      the debug name, null if none was provided
    • getGeneratedName

      String getGeneratedName(JavaOutputSink sink)
      Retrieve the actual identifier name that would be generated to the provided sink.
      Parameters:
      sink -
      Returns:
    • getGeneratedType

      String getGeneratedType(JavaOutputSink sink)
      Retrieve the actual type name that would be generated to the provided sink.
      Parameters:
      sink -
      Returns:
    • duplicate

      IJavaIdentifier duplicate()
      Description copied from interface: IJavaElement
      Duplicate this element.
      Specified by:
      duplicate in interface IJavaElement
      Specified by:
      duplicate in interface IJavaExpression
      Specified by:
      duplicate in interface IJavaLeftExpression
      Returns:
      a (possibly) duplicated object of the same type
    • generate

      void generate(JavaOutputSink out, boolean definition)
      Custom AST code generator that allows specifying whether the generation of this identifier is part of its initial definition.
      Parameters:
      out -
      definition - true if this identifier is generated by its containing IJavaDefinition element