Interface CtVariable<T>

All Superinterfaces:
Cloneable, CtElement, CtModifiable, CtNamedElement, CtQueryable, CtTypedElement<T>, CtVisitable, FactoryAccessor, Serializable, SourcePositionHolder
All Known Subinterfaces:
CtCatchVariable<T>, CtEnumValue<T>, CtField<T>, CtLocalVariable<T>, CtParameter<T>, CtResource<T>
All Known Implementing Classes:
CtCatchVariableImpl, CtEnumValueImpl, CtFieldImpl, CtLocalVariableImpl, CtParameterImpl

public interface CtVariable<T> extends CtNamedElement, CtTypedElement<T>, CtModifiable
This abstract element defines a variable declaration.
  • Method Details

    • getDefaultExpression

      CtExpression<T> getDefaultExpression()
      Gets the initialization expression assigned to the variable (also known as the initializer), when declared.
    • getReference

      CtVariableReference<T> getReference()
      Description copied from interface: CtNamedElement
      Returns the corresponding reference.
      Specified by:
      getReference in interface CtNamedElement
    • setDefaultExpression

      <C extends CtVariable<T>> C setDefaultExpression(CtExpression<T> assignedExpression)
      Sets the initialization expression assigned to the variable, when declared.
    • isPartOfJointDeclaration

      boolean isPartOfJointDeclaration()
      Returns true it the variable (field, localvariable) is jointly declared with a share type Eg int a,b; Warning: is computed on demand