Class CtAnnotationTypeImpl<T extends Annotation>
java.lang.Object
spoon.support.reflect.declaration.CtElementImpl
spoon.support.reflect.declaration.CtNamedElementImpl
spoon.support.reflect.declaration.CtTypeImpl<T>
spoon.support.reflect.declaration.CtAnnotationTypeImpl<T>
- All Implemented Interfaces:
Serializable,Cloneable,FactoryAccessor,SourcePositionHolder,CtAnnotationType<T>,CtElement,CtFormalTypeDeclarer,CtModifiable,CtNamedElement,CtShadowable,CtType<T>,CtTypeInformation,CtTypeMember,CtQueryable,CtVisitable
public class CtAnnotationTypeImpl<T extends Annotation>
extends CtTypeImpl<T>
implements CtAnnotationType<T>
The implementation for
CtAnnotationType.- Author:
- Renaud Pawlak
- See Also:
-
Field Summary
Fields inherited from class spoon.support.reflect.declaration.CtElementImpl
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parentFields inherited from interface spoon.reflect.declaration.CtType
INNERTTYPE_SEPARATOR, NAME_UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts a visitorAdds a method to this type.clone()Clone the element which calls this method in a new object.Returns the formal type parameters of this generic element.Returns a reference to the type directly extended by this type.Set<CtTypeReference<?>>Returns the interface types directly implemented by this class or extended by this interface.booleanReturns true if this type is an annotation type.booleanisSubtypeOf(CtTypeReference<?> type) Checks if this type is a subtype of the given type.<C extends CtFormalTypeDeclarer>
CsetFormalCtTypeParameters(List<CtTypeParameter> formalTypeParameters) Sets the type parameters of this generic element.setSuperclass(CtTypeReference<?> superClass) Sets the superclass type.setSuperInterfaces(Set<CtTypeReference<?>> interfaces) Sets the super interfaces of this type.Methods inherited from class spoon.support.reflect.declaration.CtTypeImpl
addField, addField, addFieldAtTop, addFormalCtTypeParameter, addFormalCtTypeParameterAt, addModifier, addNestedType, addSuperInterface, addTypeMember, addTypeMemberAt, compileAndReplaceSnippets, copyType, getActualClass, getAllExecutables, getAllFields, getAllMethods, getDeclaredExecutables, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getDeclaringType, getExtendedModifiers, getField, getFields, getMethod, getMethod, getMethods, getMethodsAnnotatedWith, getMethodsByName, getModifiers, getNestedType, getNestedTypes, getPackage, getQualifiedName, getReference, getTopLevelType, getTypeErasure, getTypeMembers, getUsedTypes, getVisibility, hasMethod, hasModifier, hasSameParameters, isAbstract, isAnonymous, isArray, isClass, isEnum, isFinal, isGenerics, isInterface, isLocalType, isNative, isParameterized, isPrimitive, isPrivate, isProtected, isPublic, isShadow, isStatic, isStrictfp, isSynchronized, isTopLevel, isTransient, isVolatile, removeField, removeFormalCtTypeParameter, removeMethod, removeModifier, removeNestedType, removeSuperInterface, removeTypeMember, setExtendedModifiers, setFields, setMethods, setModifiers, setNestedTypes, setShadow, setSimpleName, setTypeMembers, setVisibility, toStringWithImportsMethods inherited from class spoon.support.reflect.declaration.CtNamedElementImpl
getSimpleNameMethods inherited from class spoon.support.reflect.declaration.CtElementImpl
addAnnotation, addComment, asIterable, comment, delete, descendantIterator, emptyList, emptySet, equals, 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, setComments, setDocComment, setFactory, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, unmodifiableList, updateAllParentsBelowMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface spoon.reflect.declaration.CtAnnotationType
setMethodsMethods 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.CtFormalTypeDeclarer
addFormalCtTypeParameter, addFormalCtTypeParameterAt, removeFormalCtTypeParameterMethods 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
setSimpleNameMethods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, mapMethods inherited from interface spoon.reflect.declaration.CtShadowable
isShadow, setShadowMethods inherited from interface spoon.reflect.declaration.CtType
addField, addField, addFieldAtTop, addNestedType, addSuperInterface, addTypeMember, addTypeMemberAt, compileAndReplaceSnippets, copyType, getActualClass, getAllMethods, getField, getFields, getMethod, getMethod, getMethods, getMethodsAnnotatedWith, getMethodsByName, getNestedType, getNestedTypes, getPackage, getReference, getSimpleName, getTypeMembers, getUsedTypes, hasMethod, isTopLevel, removeField, removeMethod, removeNestedType, removeSuperInterface, removeTypeMember, setFields, setNestedTypes, setTypeMembers, toStringWithImportsMethods inherited from interface spoon.reflect.declaration.CtTypeInformation
getAllExecutables, getAllFields, getDeclaredExecutables, getDeclaredField, getDeclaredFields, getDeclaredOrInheritedField, getModifiers, getQualifiedName, getTypeErasure, isAnonymous, isArray, isClass, isEnum, isGenerics, isInterface, isLocalType, isParameterized, isPrimitiveMethods inherited from interface spoon.reflect.declaration.CtTypeMember
getDeclaringType, getTopLevelTypeMethods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Constructor Details
-
CtAnnotationTypeImpl
public CtAnnotationTypeImpl()
-
-
Method Details
-
accept
Description copied from interface:CtVisitableAccepts a visitor- Specified by:
acceptin interfaceCtVisitable
-
isAnnotationType
public boolean isAnnotationType()Description copied from interface:CtTypeInformationReturns true if this type is an annotation type.- Specified by:
isAnnotationTypein interfaceCtTypeInformation- Overrides:
isAnnotationTypein classCtTypeImpl<T extends Annotation>
-
getSuperInterfaces
Description copied from interface:CtTypeInformationReturns the interface types directly implemented by this class or extended by this interface.- Specified by:
getSuperInterfacesin interfaceCtTypeInformation- Overrides:
getSuperInterfacesin classCtTypeImpl<T extends Annotation>
-
getSuperclass
Description copied from interface:CtTypeInformationReturns a reference to the type directly extended by this type.To get the
CtTypeof the super class, useCtTypeReference.getDeclaration()orCtTypeReference.getTypeDeclaration()on theCtTypeReferencereturned by this method.- Specified by:
getSuperclassin interfaceCtTypeInformation- Overrides:
getSuperclassin classCtTypeImpl<T extends Annotation>- Returns:
- the type explicitly extended by this type, or
nullif there is none or if the super type is not in the classpath (in noclasspath mode). If a class does not explicitly extend another classnullis returned (notObject). For types like enums that implicitly extend a superclass likeEnum, this method returns that class.
-
setSuperclass
Description copied from interface:CtTypeSets the superclass type.- Specified by:
setSuperclassin interfaceCtAnnotationType<T extends Annotation>- Specified by:
setSuperclassin interfaceCtType<T extends Annotation>- Overrides:
setSuperclassin classCtTypeImpl<T extends Annotation>
-
setSuperInterfaces
Description copied from interface:CtTypeSets the super interfaces of this type.- Specified by:
setSuperInterfacesin interfaceCtAnnotationType<T extends Annotation>- Specified by:
setSuperInterfacesin interfaceCtType<T extends Annotation>- Overrides:
setSuperInterfacesin classCtTypeImpl<T extends Annotation>
-
getFormalCtTypeParameters
Description copied from interface:CtFormalTypeDeclarerReturns the formal type parameters of this generic element.- Specified by:
getFormalCtTypeParametersin interfaceCtFormalTypeDeclarer- Overrides:
getFormalCtTypeParametersin classCtTypeImpl<T extends Annotation>
-
setFormalCtTypeParameters
public <C extends CtFormalTypeDeclarer> C setFormalCtTypeParameters(List<CtTypeParameter> formalTypeParameters) Description copied from interface:CtFormalTypeDeclarerSets the type parameters of this generic element.- Specified by:
setFormalCtTypeParametersin interfaceCtAnnotationType<T extends Annotation>- Specified by:
setFormalCtTypeParametersin interfaceCtFormalTypeDeclarer- Overrides:
setFormalCtTypeParametersin classCtTypeImpl<T extends Annotation>
-
isSubtypeOf
Description copied from interface:CtTypeInformationChecks if this type is a subtype of the given type.- Specified by:
isSubtypeOfin interfaceCtTypeInformation- Parameters:
type- the type that might be a parent of this type.- Returns:
trueif the referenced type is a subtype of the given type, otherwisefalse. If this type is the same as the given type (typeX.isSubtypeOf(typeX)), this method returnstrue.
-
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 interfaceCtAnnotationType<T extends Annotation>- Specified by:
clonein interfaceCtElement- Specified by:
clonein interfaceCtNamedElement- Specified by:
clonein interfaceCtType<T extends Annotation>- Overrides:
clonein classCtTypeImpl<T extends Annotation>- Returns:
- a clone of this element. All children are cloned, but the parent of the returned clone is set to null.
-
getAnnotationMethods
- Specified by:
getAnnotationMethodsin interfaceCtAnnotationType<T extends Annotation>
-
addMethod
Description copied from interface:CtTypeAdds a method to this type.- Specified by:
addMethodin interfaceCtAnnotationType<T extends Annotation>- Specified by:
addMethodin interfaceCtType<T extends Annotation>- Overrides:
addMethodin classCtTypeImpl<T extends Annotation>
-