Package spoon.reflect.reference
Interface CtArrayTypeReference<T>
- All Superinterfaces:
Cloneable
,CtActualTypeContainer
,CtElement
,CtQueryable
,CtReference
,CtShadowable
,CtTypeInformation
,CtTypeReference<T>
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
- All Known Implementing Classes:
CtArrayTypeReferenceImpl
This interface defines a reference to an array.
-
Field Summary
Fields inherited from interface spoon.reflect.reference.CtTypeReference
NULL_TYPE_NAME, OMITTED_TYPE_ARG_NAME
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone the element which calls this method in a new object.Gets the type of the array elements at the finest grain.Gets the type of the elements contained in this array.int
Returns the number of dimensions of this array type.Returns the simple name of the array type core component type (with no []s).<C extends CtArrayTypeReference<T>>
CsetComponentType(CtTypeReference<?> componentType)
Sets the type of the elements contained in this array.<T extends CtReference>
TsetSimpleName(String simpleName)
The simple name of an ArrayTypeReference is unsettable as it's retrieved from its component type.Methods inherited from interface spoon.reflect.reference.CtActualTypeContainer
addActualTypeArgument, getActualTypeArguments, removeActualTypeArgument, setActualTypeArguments
Methods inherited from interface spoon.reflect.declaration.CtElement
addAnnotation, addComment, asIterable, delete, descendantIterator, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hasParent, isImplicit, isParentInitialized, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
Methods inherited from interface spoon.reflect.reference.CtReference
setComments
Methods inherited from interface spoon.reflect.declaration.CtShadowable
isShadow, setShadow
Methods inherited from interface spoon.reflect.declaration.CtTypeInformation
getAllExecutables, getAllFields, getDeclaredExecutables, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getQualifiedName, getTypeErasure, isAnnotationType, isAnonymous, isArray, isClass, isEnum, isGenerics, isInterface, isLocalType, isParameterized, isPrimitive, isSubtypeOf
Methods inherited from interface spoon.reflect.reference.CtTypeReference
asCtIntersectionTypeReference, box, canAccess, canAccess, getAccessType, getActualClass, getDeclaration, getDeclaringType, getModifiers, getPackage, getSuperclass, getSuperInterfaces, getTopLevelType, getTypeDeclaration, getTypeParameterDeclaration, isSimplyQualified, setDeclaringType, setPackage, setSimplyQualified, unbox
Methods inherited from interface spoon.reflect.visitor.CtVisitable
accept
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Method Details
-
getComponentType
CtTypeReference<?> getComponentType()Gets the type of the elements contained in this array. e.g., if you have the arrayint[][][]
, this method returns a type reference forint[][]
. -
getArrayType
CtTypeReference<?> getArrayType()Gets the type of the array elements at the finest grain. e.g., if you have the arrayint[][][]
, this method returns a type reference to "int". -
setComponentType
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 (seegetComponentType()
). -
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 interfaceCtReference
- Specified by:
getSimpleName
in interfaceCtTypeReference<T>
-
setSimpleName
The simple name of an ArrayTypeReference is unsettable as it's retrieved from its component type.- Specified by:
setSimpleName
in interfaceCtReference
-
clone
CtArrayTypeReference<T> 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 methodsRefactoring.copyType(CtType)
andRefactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtReference
- Specified by:
clone
in interfaceCtTypeReference<T>
-