Package spoon.reflect.reference
Interface CtTypeParameterReference
- All Superinterfaces:
Cloneable
,CtActualTypeContainer
,CtElement
,CtQueryable
,CtReference
,CtShadowable
,CtTypeInformation
,CtTypeReference<Object>
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
- All Known Subinterfaces:
CtWildcardReference
- All Known Implementing Classes:
CtTypeParameterReferenceImpl
,CtWildcardReferenceImpl
This interface defines a reference to a type parameter (aka generics).
-
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.A type parameter can have anextends
clause which declare one (CtTypeReference
or more (CtIntersectionTypeReference
references.Returns theCtTypeParameter
, aCtTypeParameter
, that declares the type parameter referenced ornull
if the reference is not in a context where such type parameter is declared.boolean
Returns true if this has the default bounding type that is java.lang.Object (which basically means that there is no bound)<T extends CtActualTypeContainer>
TsetActualTypeArguments(List<? extends CtTypeReference<?>> actualTypeArguments)
Sets the type arguments.Methods inherited from interface spoon.reflect.reference.CtActualTypeContainer
addActualTypeArgument, getActualTypeArguments, removeActualTypeArgument
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, setSimpleName
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, getDeclaringType, getModifiers, getPackage, getSimpleName, 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
-
getBoundingType
CtTypeReference<?> getBoundingType()A type parameter can have anextends
clause which declare one (CtTypeReference
or more (CtIntersectionTypeReference
references.// Extends with generics. T extends Interface1 // Intersection type with generics. T extends Interface1 & Interface2
-
getDeclaration
CtTypeParameter getDeclaration()Returns theCtTypeParameter
, aCtTypeParameter
, that declares the type parameter referenced ornull
if the reference is not in a context where such type parameter is declared. See alsoCtTypeReference.getTypeParameterDeclaration()
which has a different semantic.- Specified by:
getDeclaration
in interfaceCtReference
- Specified by:
getDeclaration
in interfaceCtTypeReference<Object>
- Returns:
- the referenced element or
null
if the type declaration is not the analyzed source files.
-
clone
CtTypeParameterReference 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<Object>
-
setActualTypeArguments
<T extends CtActualTypeContainer> T setActualTypeArguments(List<? extends CtTypeReference<?>> actualTypeArguments)Description copied from interface:CtActualTypeContainer
Sets the type arguments.- Specified by:
setActualTypeArguments
in interfaceCtActualTypeContainer
-
isDefaultBoundingType
boolean isDefaultBoundingType()Returns true if this has the default bounding type that is java.lang.Object (which basically means that there is no bound)
-