Package spoon.reflect.reference
Interface CtWildcardReference
-
- All Superinterfaces:
Cloneable
,CtActualTypeContainer
,CtElement
,CtQueryable
,CtReference
,CtShadowable
,CtTypeInformation
,CtTypeParameterReference
,CtTypeReference<Object>
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
- All Known Implementing Classes:
CtWildcardReferenceImpl
public interface CtWildcardReference extends CtTypeParameterReference
Represents a wildcard in generic type annotations, i.e. the "?" (e.g. the "?" in Collection<?> or Collection<? extends List>).
-
-
Field Summary
-
Fields inherited from interface spoon.reflect.reference.CtTypeReference
NULL_TYPE_NAME, OMITTED_TYPE_ARG_NAME
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CtWildcardReference
clone()
Clone the element which calls this method in a new object.CtTypeReference<?>
getBoundingType()
A type parameter can have anextends
clause which declare one (CtTypeReference
or more (CtIntersectionTypeReference
references.boolean
isUpper()
Returnstrue
if the bounds are inextends
clause.<T extends CtWildcardReference>
TsetBoundingType(CtTypeReference<?> superType)
Sets theextends
clause of the type parameter.<C extends CtReference>
CsetSimpleName(String simpleName)
Sets the name of referenced element.<T extends CtWildcardReference>
TsetUpper(boolean upper)
Set totrue
to writeextends
clause for bounds types.-
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
-
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.CtTypeParameterReference
getDeclaration, isDefaultBoundingType, setActualTypeArguments
-
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 Detail
-
clone
CtWildcardReference 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 interfaceCtTypeParameterReference
- Specified by:
clone
in interfaceCtTypeReference<Object>
-
setSimpleName
<C extends CtReference> C setSimpleName(String simpleName)
Description copied from interface:CtReference
Sets the name of referenced element.- Specified by:
setSimpleName
in interfaceCtReference
-
isUpper
boolean isUpper()
Returnstrue
if the bounds are inextends
clause.false
means asuper
clause.
-
setUpper
<T extends CtWildcardReference> T setUpper(boolean upper)
Set totrue
to writeextends
clause for bounds types.
-
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
- Specified by:
getBoundingType
in interfaceCtTypeParameterReference
-
setBoundingType
<T extends CtWildcardReference> T setBoundingType(CtTypeReference<?> superType)
Sets theextends
clause of the type parameter.
-
-