Package spoon.reflect.declaration
Interface CtAnnotationMethod<T>
- All Superinterfaces:
Cloneable
,CtBodyHolder
,CtElement
,CtExecutable<T>
,CtFormalTypeDeclarer
,CtMethod<T>
,CtModifiable
,CtNamedElement
,CtQueryable
,CtShadowable
,CtTypedElement<T>
,CtTypeMember
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
- All Known Implementing Classes:
CtAnnotationMethodImpl
This element defines an annotation method declared in an annotation type.
-
Field Summary
Fields inherited from interface spoon.reflect.declaration.CtExecutable
EXECUTABLE_SEPARATOR
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone the element which calls this method in a new object.Gets the default expression assigned to the annotation method.<T1 extends CtBodyHolder>
T1setBody(CtStatement body)
Sets the body of this element.<C extends CtAnnotationMethod<T>>
CsetDefaultExpression(CtExpression<T> assignedExpression)
Sets the default expression assigned to the annotation method.<T extends CtFormalTypeDeclarer>
TsetFormalCtTypeParameters(List<CtTypeParameter> formalTypeParameters)
Sets the type parameters of this generic element.<T1 extends CtExecutable<T>>
T1setParameters(List<CtParameter<?>> parameters)
Sets the parameters.<T1 extends CtExecutable<T>>
T1setThrownTypes(Set<CtTypeReference<? extends Throwable>> thrownTypes)
Sets the thrown types.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, updateAllParentsBelow
Methods inherited from interface spoon.reflect.declaration.CtExecutable
addParameter, addParameterAt, addThrownType, getBody, getParameters, getReference, getSignature, getThrownTypes, removeParameter, removeThrownType
Methods inherited from interface spoon.reflect.declaration.CtFormalTypeDeclarer
addFormalCtTypeParameter, addFormalCtTypeParameterAt, getFormalCtTypeParameters, removeFormalCtTypeParameter
Methods inherited from interface spoon.reflect.declaration.CtMethod
copyMethod, getTopDefinitions, isDefaultMethod, isOverriding, setDefaultMethod
Methods 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, setVisibility
Methods inherited from interface spoon.reflect.declaration.CtNamedElement
getSimpleName, setSimpleName
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
Methods inherited from interface spoon.reflect.declaration.CtShadowable
isShadow, setShadow
Methods inherited from interface spoon.reflect.declaration.CtTypedElement
getType, setType
Methods inherited from interface spoon.reflect.declaration.CtTypeMember
getDeclaringType, getTopLevelType
Methods inherited from interface spoon.reflect.visitor.CtVisitable
accept
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Method Details
-
getDefaultExpression
CtExpression<T> getDefaultExpression()Gets the default expression assigned to the annotation method. -
setDefaultExpression
Sets the default expression assigned to the annotation method. -
clone
CtAnnotationMethod<T> 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 interfaceCtExecutable<T>
- Specified by:
clone
in interfaceCtMethod<T>
- Specified by:
clone
in interfaceCtNamedElement
-
setBody
Description copied from interface:CtBodyHolder
Sets the body of this element. If body is not a block, it is wrapped in a CtBlock which is semantically equivalent and eases transformation afterwards if required.- Specified by:
setBody
in interfaceCtBodyHolder
-
setThrownTypes
<T1 extends CtExecutable<T>> T1 setThrownTypes(Set<CtTypeReference<? extends Throwable>> thrownTypes)Description copied from interface:CtExecutable
Sets the thrown types.- Specified by:
setThrownTypes
in interfaceCtExecutable<T>
-
setFormalCtTypeParameters
<T extends CtFormalTypeDeclarer> T setFormalCtTypeParameters(List<CtTypeParameter> formalTypeParameters)Description copied from interface:CtFormalTypeDeclarer
Sets the type parameters of this generic element.- Specified by:
setFormalCtTypeParameters
in interfaceCtFormalTypeDeclarer
-
setParameters
Description copied from interface:CtExecutable
Sets the parameters.- Specified by:
setParameters
in interfaceCtExecutable<T>
-