Package spoon.reflect.declaration
Interface CtFormalTypeDeclarer
- All Superinterfaces:
Cloneable,CtElement,CtModifiable,CtNamedElement,CtQueryable,CtTypeMember,CtVisitable,FactoryAccessor,Serializable,SourcePositionHolder
- All Known Subinterfaces:
CtAnnotationMethod<T>,CtAnnotationType<T>,CtClass<T>,CtConstructor<T>,CtEnum<T>,CtInterface<T>,CtMethod<T>,CtRecord,CtType<T>,CtTypeParameter
- All Known Implementing Classes:
CtAnnotationMethodImpl,CtAnnotationTypeImpl,CtClassImpl,CtConstructorImpl,CtEnumImpl,CtInterfaceImpl,CtMethodImpl,CtRecordImpl,CtTypeImpl,CtTypeParameterImpl,InvisibleArrayConstructorImpl
This abstract element defines a declaration that accepts formal type
parameters (aka generics), such as a CtType (
class A<E>), CtMethod or CtConstructor.-
Method Summary
Modifier and TypeMethodDescription<T extends CtFormalTypeDeclarer>
TaddFormalCtTypeParameter(CtTypeParameter formalTypeParameter) Add a type parameter to this generic element.<T extends CtFormalTypeDeclarer>
TaddFormalCtTypeParameterAt(int position, CtTypeParameter formalTypeParameter) Add a type parameter at a specific position.Returns the formal type parameters of this generic element.booleanremoveFormalCtTypeParameter(CtTypeParameter formalTypeParameter) Removes a type parameters from this generic element.<T extends CtFormalTypeDeclarer>
TsetFormalCtTypeParameters(List<CtTypeParameter> formalTypeParameters) Sets the type parameters of this generic element.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, setComments, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelowMethods inherited from interface spoon.reflect.declaration.CtModifiable
addModifier, getExtendedModifiers, getModifiers, getVisibility, hasModifier, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, removeModifier, setExtendedModifiers, setModifiers, setVisibilityMethods inherited from interface spoon.reflect.declaration.CtNamedElement
clone, getReference, getSimpleName, setSimpleNameMethods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, mapMethods inherited from interface spoon.reflect.declaration.CtTypeMember
getDeclaringType, getTopLevelTypeMethods inherited from interface spoon.reflect.visitor.CtVisitable
acceptMethods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Method Details
-
getFormalCtTypeParameters
List<CtTypeParameter> getFormalCtTypeParameters()Returns the formal type parameters of this generic element. -
setFormalCtTypeParameters
<T extends CtFormalTypeDeclarer> T setFormalCtTypeParameters(List<CtTypeParameter> formalTypeParameters) Sets the type parameters of this generic element. -
addFormalCtTypeParameter
Add a type parameter to this generic element. -
addFormalCtTypeParameterAt
<T extends CtFormalTypeDeclarer> T addFormalCtTypeParameterAt(int position, CtTypeParameter formalTypeParameter) Add a type parameter at a specific position.- Parameters:
position- Position to insert the type parameter atformalTypeParameter- The type parameter to insert- Returns:
- The receiver
-
removeFormalCtTypeParameter
Removes a type parameters from this generic element.
-