Interface CtArrayTypeReference<T>

All Superinterfaces:
Cloneable, CtActualTypeContainer, CtElement, CtQueryable, CtReference, CtShadowable, CtTypeInformation, CtTypeReference<T>, CtVisitable, FactoryAccessor, Serializable, SourcePositionHolder
All Known Implementing Classes:
CtArrayTypeReferenceImpl

public interface CtArrayTypeReference<T> extends CtTypeReference<T>
This interface defines a reference to an array.
  • Method Details

    • getComponentType

      CtTypeReference<?> getComponentType()
      Gets the type of the elements contained in this array. e.g., if you have the array int[][][], this method returns a type reference for int[][].
    • getArrayType

      CtTypeReference<?> getArrayType()
      Gets the type of the array elements at the finest grain. e.g., if you have the array int[][][], this method returns a type reference to "int".
    • setComponentType

      <C extends CtArrayTypeReference<T>> C setComponentType(CtTypeReference<?> componentType)
      Sets the type of the elements contained in this array.
    • getDimensionCount

      int getDimensionCount()
      Returns the number of dimensions of this array type. This corresponds to the number of array types recursively embedded into the current one (see getComponentType()).
    • getSimpleName

      String getSimpleName()
      Returns the simple name of the array type core component type (with no []s). Use toString() to get the full array type including []s.
      Specified by:
      getSimpleName in interface CtReference
      Specified by:
      getSimpleName in interface CtTypeReference<T>
    • setSimpleName

      <T extends CtReference> T setSimpleName(String simpleName)
      The simple name of an ArrayTypeReference is unsettable as it's retrieved from its component type.
      Specified by:
      setSimpleName in interface CtReference
    • clone

      Description copied from interface: CtElement
      Clone the element which calls this method in a new object. Note that that references are kept as is, and thus, so if you clone whole classes or methods, some parts of the cloned element (eg executable references) may still point to the initial element. In this case, consider using methods Refactoring.copyType(CtType) and Refactoring.copyMethod(CtMethod) instead which does additional work beyond cloning.
      Specified by:
      clone in interface CtElement
      Specified by:
      clone in interface CtReference
      Specified by:
      clone in interface CtTypeReference<T>