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.intReturns 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, setActualTypeArgumentsMethods 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, updateAllParentsBelowMethods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, mapMethods inherited from interface spoon.reflect.reference.CtReference
setCommentsMethods inherited from interface spoon.reflect.declaration.CtShadowable
isShadow, setShadowMethods 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, isSubtypeOfMethods 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, unboxMethods inherited from interface spoon.reflect.visitor.CtVisitable
acceptMethods 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:
getSimpleNamein interfaceCtReference- Specified by:
getSimpleNamein interfaceCtTypeReference<T>
-
setSimpleName
The simple name of an ArrayTypeReference is unsettable as it's retrieved from its component type.- Specified by:
setSimpleNamein interfaceCtReference
-
clone
CtArrayTypeReference<T> clone()Description copied from interface:CtElementClone 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:
clonein interfaceCtElement- Specified by:
clonein interfaceCtReference- Specified by:
clonein interfaceCtTypeReference<T>- Returns:
- a clone of this element. All children are cloned, but the parent of the returned clone is set to null.
-