public class CtWildcardReferenceImpl extends CtTypeParameterReferenceImpl implements CtWildcardReference
simplename
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
NULL_TYPE_NAME, OMITTED_TYPE_ARG_NAME
Constructor and Description |
---|
CtWildcardReferenceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
accept(CtVisitor visitor)
Accepts a visitor
|
CtWildcardReference |
clone()
Clone the element which calls this method in a new object.
|
java.lang.Class<java.lang.Object> |
getActualClass()
Gets the Java runtime class of the referenced type.
|
CtTypeReference<?> |
getBoundingType()
A type parameter can have an
extends clause which declare
one (CtTypeReference or more (CtIntersectionTypeReference references. |
CtType<java.lang.Object> |
getTypeDeclaration()
Returns the
CtType that corresponds to the reference even if the
type isn't in the Spoon source path (in this case, the Spoon elements are
built with runtime reflection, and the resulting CtType is called a "shadow" class,
see CtShadowable.isShadow() ). |
boolean |
isUpper()
Returns
true if the bounds are in extends clause. |
protected boolean |
isWildcard() |
<T extends CtWildcardReference> |
setBoundingType(CtTypeReference<?> superType)
Sets the
extends clause of the type parameter. |
<T extends CtReference> |
setSimpleName(java.lang.String simplename)
Sets the name of referenced element.
|
<T extends CtWildcardReference> |
setUpper(boolean upper)
Set to
true to write extends clause for bounds types. |
addActualTypeArgument, getActualAnnotatedElement, getActualTypeArguments, getDeclaration, getTypeErasure, isDefaultBoundingType, isGenerics, isPrimitive, isSimplyQualified, isSubtypeOf, removeActualTypeArgument, setActualTypeArguments, setSimplyQualified
asCtIntersectionTypeReference, box, canAccess, canAccess, findClass, getAccessType, getAllExecutables, getAllFields, getDeclaredExecutables, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getDeclaringType, getModifiers, getPackage, getQualifiedName, getSuperclass, getSuperInterfaces, getTopLevelType, getTypeParameterDeclaration, isAnnotationType, isAnonymous, isArray, isClass, isEnum, isInterface, isLocalType, isParameterized, isShadow, setDeclaringType, setPackage, setShadow, unbox
equals, getSimpleName, setComments
addAnnotation, addComment, asIterable, comment, delete, descendantIterator, emptyList, emptySet, filterChildren, getAllMetadata, getAnnotatedChildren, getAnnotation, getAnnotation, getAnnotations, getComments, getDirectChildren, getDocComment, getElements, getFactory, getMetadata, getMetadataKeys, getOriginalSourceFragment, getParent, getParent, getParent, getPath, getPosition, getReferencedTypes, getRoleInParent, getShortRepresentation, getValueByRole, hasAnnotation, hashCode, hasParent, isImplicit, isParentInitialized, map, map, prettyprint, putMetadata, removeAnnotation, removeComment, replace, replace, setAllMetadata, setAnnotations, setDocComment, setFactory, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, unmodifiableList, updateAllParentsBelow
finalize, getClass, notify, notifyAll, wait, wait, wait
getDeclaration, isDefaultBoundingType, setActualTypeArguments
asCtIntersectionTypeReference, box, canAccess, canAccess, getAccessType, getDeclaringType, getModifiers, getPackage, getSimpleName, getSuperclass, getSuperInterfaces, getTopLevelType, getTypeParameterDeclaration, isSimplyQualified, setDeclaringType, setPackage, setSimplyQualified, unbox
setComments
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
getFactory, setFactory
filterChildren, map, map
addActualTypeArgument, getActualTypeArguments, removeActualTypeArgument
getAllExecutables, getAllFields, getDeclaredExecutables, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getQualifiedName, getTypeErasure, isAnnotationType, isAnonymous, isArray, isClass, isEnum, isGenerics, isInterface, isLocalType, isParameterized, isPrimitive, isSubtypeOf
isShadow, setShadow
public void accept(CtVisitor visitor)
CtVisitable
accept
in interface CtVisitable
accept
in class CtTypeParameterReferenceImpl
public boolean isUpper()
CtWildcardReference
true
if the bounds are in extends
clause.
false
means a super
clause.isUpper
in interface CtWildcardReference
public <T extends CtWildcardReference> T setUpper(boolean upper)
CtWildcardReference
true
to write extends
clause for bounds types.setUpper
in interface CtWildcardReference
public <T extends CtWildcardReference> T setBoundingType(CtTypeReference<?> superType)
CtWildcardReference
extends
clause of the type parameter.setBoundingType
in interface CtWildcardReference
public CtTypeReference<?> getBoundingType()
CtTypeParameterReference
extends
clause which declare
one (CtTypeReference
or more (CtIntersectionTypeReference
references.
// Extends with generics. T extends Interface1 // Intersection type with generics. T extends Interface1 & Interface2
getBoundingType
in interface CtTypeParameterReference
getBoundingType
in interface CtWildcardReference
getBoundingType
in class CtTypeParameterReferenceImpl
public <T extends CtReference> T setSimpleName(java.lang.String simplename)
CtReference
setSimpleName
in interface CtReference
setSimpleName
in interface CtWildcardReference
setSimpleName
in class CtReferenceImpl
public CtWildcardReference clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtElement
clone
in interface CtReference
clone
in interface CtTypeParameterReference
clone
in interface CtTypeReference<java.lang.Object>
clone
in interface CtWildcardReference
clone
in class CtTypeParameterReferenceImpl
public CtType<java.lang.Object> getTypeDeclaration()
CtTypeReference
CtType
that corresponds to the reference even if the
type isn't in the Spoon source path (in this case, the Spoon elements are
built with runtime reflection, and the resulting CtType is called a "shadow" class,
see CtShadowable.isShadow()
).getTypeDeclaration
in interface CtTypeReference<java.lang.Object>
getTypeDeclaration
in class CtTypeParameterReferenceImpl
public java.lang.Class<java.lang.Object> getActualClass()
CtTypeReference
CtTypeReference.getTypeDeclaration()
instead,
in order to only stay in the Spoon world and manipulate CtType instead of java.lang.Class.getActualClass
in interface CtTypeReference<java.lang.Object>
getActualClass
in class CtTypeParameterReferenceImpl
SpoonClassNotFoundException
if the class is not found.protected boolean isWildcard()
isWildcard
in class CtTypeParameterReferenceImpl
Copyright © 2007–2021 Inria. All rights reserved.