Class CtAnnotationMethodImpl<T>
- java.lang.Object
-
- spoon.support.reflect.declaration.CtElementImpl
-
- spoon.support.reflect.declaration.CtNamedElementImpl
-
- spoon.support.reflect.declaration.CtExecutableImpl<T>
-
- spoon.support.reflect.declaration.CtMethodImpl<T>
-
- spoon.support.reflect.declaration.CtAnnotationMethodImpl<T>
-
- All Implemented Interfaces:
Serializable
,Cloneable
,FactoryAccessor
,CtBodyHolder
,SourcePositionHolder
,CtAnnotationMethod<T>
,CtElement
,CtExecutable<T>
,CtFormalTypeDeclarer
,CtMethod<T>
,CtModifiable
,CtNamedElement
,CtShadowable
,CtTypedElement<T>
,CtTypeMember
,CtQueryable
,CtVisitable
public class CtAnnotationMethodImpl<T> extends CtMethodImpl<T> implements CtAnnotationMethod<T>
The implementation forCtAnnotationMethod
.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class spoon.support.reflect.declaration.CtElementImpl
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
-
Fields inherited from interface spoon.reflect.declaration.CtExecutable
EXECUTABLE_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description CtAnnotationMethodImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(CtVisitor v)
Accepts a visitorCtAnnotationMethod<T>
clone()
Clone the element which calls this method in a new object.CtBlock<T>
getBody()
Gets the body expression.CtExpression<T>
getDefaultExpression()
Gets the default expression assigned to the annotation method.List<CtTypeParameter>
getFormalCtTypeParameters()
Returns the formal type parameters of this generic element.List<CtParameter<?>>
getParameters()
Gets the parameters list.Set<CtTypeReference<? extends Throwable>>
getThrownTypes()
Returns the exceptions and other throwables listed in this method or constructor's throws clause.<T extends CtBodyHolder>
TsetBody(CtStatement statement)
Sets the body of this element.<C extends CtAnnotationMethod<T>>
CsetDefaultExpression(CtExpression<T> assignedExpression)
Sets the default expression assigned to the annotation method.<C extends CtFormalTypeDeclarer>
CsetFormalCtTypeParameters(List<CtTypeParameter> formalTypeParameters)
Sets the type parameters of this generic element.<U extends CtExecutable<T>>
UsetParameters(List<CtParameter<?>> parameters)
Sets the parameters.<U extends CtExecutable<T>>
UsetThrownTypes(Set<CtTypeReference<? extends Throwable>> thrownTypes)
Sets the thrown types.-
Methods inherited from class spoon.support.reflect.declaration.CtMethodImpl
addFormalCtTypeParameter, addFormalCtTypeParameterAt, addModifier, copyMethod, getExtendedModifiers, getModifiers, getTopDefinitions, getType, getVisibility, hasModifier, isAbstract, isDefaultMethod, isFinal, isNative, isOverriding, isPrivate, isProtected, isPublic, isShadow, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, removeFormalCtTypeParameter, removeModifier, setDefaultMethod, setExtendedModifiers, setModifiers, setShadow, setType, setVisibility
-
Methods inherited from class spoon.support.reflect.declaration.CtExecutableImpl
addParameter, addParameterAt, addThrownType, getDeclaringType, getReference, getSignature, getTopLevelType, removeParameter, removeThrownType
-
Methods inherited from class spoon.support.reflect.declaration.CtNamedElementImpl
getSimpleName, setSimpleName
-
Methods 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, updateAllParentsBelow
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
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, getReference, getSignature, removeParameter, removeThrownType
-
Methods inherited from interface spoon.reflect.declaration.CtFormalTypeDeclarer
addFormalCtTypeParameter, addFormalCtTypeParameterAt, 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.processing.FactoryAccessor
getFactory, setFactory
-
-
-
-
Method Detail
-
accept
public void accept(CtVisitor v)
Description copied from interface:CtVisitable
Accepts a visitor- Specified by:
accept
in interfaceCtVisitable
- Overrides:
accept
in classCtMethodImpl<T>
-
getDefaultExpression
public CtExpression<T> getDefaultExpression()
Description copied from interface:CtAnnotationMethod
Gets the default expression assigned to the annotation method.- Specified by:
getDefaultExpression
in interfaceCtAnnotationMethod<T>
-
setDefaultExpression
public <C extends CtAnnotationMethod<T>> C setDefaultExpression(CtExpression<T> assignedExpression)
Description copied from interface:CtAnnotationMethod
Sets the default expression assigned to the annotation method.- Specified by:
setDefaultExpression
in interfaceCtAnnotationMethod<T>
-
getBody
public CtBlock<T> getBody()
Description copied from interface:CtExecutable
Gets the body expression.- Specified by:
getBody
in interfaceCtBodyHolder
- Specified by:
getBody
in interfaceCtExecutable<T>
- Overrides:
getBody
in classCtExecutableImpl<T>
-
setBody
public <T extends CtBodyHolder> T setBody(CtStatement statement)
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 interfaceCtAnnotationMethod<T>
- Specified by:
setBody
in interfaceCtBodyHolder
- Overrides:
setBody
in classCtExecutableImpl<T>
-
getThrownTypes
public Set<CtTypeReference<? extends Throwable>> getThrownTypes()
Description copied from interface:CtExecutable
Returns the exceptions and other throwables listed in this method or constructor's throws clause.- Specified by:
getThrownTypes
in interfaceCtExecutable<T>
- Overrides:
getThrownTypes
in classCtExecutableImpl<T>
-
setThrownTypes
public <U extends CtExecutable<T>> U setThrownTypes(Set<CtTypeReference<? extends Throwable>> thrownTypes)
Description copied from interface:CtExecutable
Sets the thrown types.- Specified by:
setThrownTypes
in interfaceCtAnnotationMethod<T>
- Specified by:
setThrownTypes
in interfaceCtExecutable<T>
- Overrides:
setThrownTypes
in classCtExecutableImpl<T>
-
getFormalCtTypeParameters
public List<CtTypeParameter> getFormalCtTypeParameters()
Description copied from interface:CtFormalTypeDeclarer
Returns the formal type parameters of this generic element.- Specified by:
getFormalCtTypeParameters
in interfaceCtFormalTypeDeclarer
- Overrides:
getFormalCtTypeParameters
in classCtMethodImpl<T>
-
setFormalCtTypeParameters
public <C extends CtFormalTypeDeclarer> C setFormalCtTypeParameters(List<CtTypeParameter> formalTypeParameters)
Description copied from interface:CtFormalTypeDeclarer
Sets the type parameters of this generic element.- Specified by:
setFormalCtTypeParameters
in interfaceCtAnnotationMethod<T>
- Specified by:
setFormalCtTypeParameters
in interfaceCtFormalTypeDeclarer
- Overrides:
setFormalCtTypeParameters
in classCtMethodImpl<T>
-
getParameters
public List<CtParameter<?>> getParameters()
Description copied from interface:CtExecutable
Gets the parameters list.- Specified by:
getParameters
in interfaceCtExecutable<T>
- Overrides:
getParameters
in classCtExecutableImpl<T>
-
setParameters
public <U extends CtExecutable<T>> U setParameters(List<CtParameter<?>> parameters)
Description copied from interface:CtExecutable
Sets the parameters.- Specified by:
setParameters
in interfaceCtAnnotationMethod<T>
- Specified by:
setParameters
in interfaceCtExecutable<T>
- Overrides:
setParameters
in classCtExecutableImpl<T>
-
clone
public 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 interfaceCtAnnotationMethod<T>
- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtExecutable<T>
- Specified by:
clone
in interfaceCtMethod<T>
- Specified by:
clone
in interfaceCtNamedElement
- Overrides:
clone
in classCtMethodImpl<T>
-
-