Package spoon.reflect.declaration
Interface CtAnonymousExecutable
-
- All Superinterfaces:
Cloneable
,CtBodyHolder
,CtElement
,CtExecutable<Void>
,CtModifiable
,CtNamedElement
,CtQueryable
,CtTypedElement<Void>
,CtTypeMember
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
- All Known Implementing Classes:
CtAnonymousExecutableImpl
public interface CtAnonymousExecutable extends CtExecutable<Void>, CtTypeMember
This element defines an anonymous executable block declaration in a class.- See Also:
CtClass
-
-
Field Summary
-
Fields inherited from interface spoon.reflect.declaration.CtExecutable
EXECUTABLE_SEPARATOR
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends CtExecutable<Void>>
TaddParameter(CtParameter<?> parameter)
Add a parameter for this executable<T extends CtExecutable<Void>>
TaddThrownType(CtTypeReference<? extends Throwable> throwType)
add a thrown type.CtAnonymousExecutable
clone()
Clone the element which calls this method in a new object.<T extends CtExecutable<Void>>
TsetParameters(List<CtParameter<?>> parameters)
Sets the parameters.<C extends CtNamedElement>
CsetSimpleName(String simpleName)
Sets the simple (unqualified) name of this element.<T extends CtExecutable<Void>>
TsetThrownTypes(Set<CtTypeReference<? extends Throwable>> thrownTypes)
Sets the thrown types.<C extends CtTypedElement>
CsetType(CtTypeReference<Void> type)
Sets this element's type.-
Methods inherited from interface spoon.reflect.code.CtBodyHolder
setBody
-
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
getBody, getParameters, getReference, getSignature, getThrownTypes, removeParameter, removeThrownType
-
Methods inherited from interface spoon.reflect.declaration.CtModifiable
addModifier, getExtendedModifiers, getModifiers, getVisibility, hasModifier, isAbstract, isFinal, isPrivate, isProtected, isPublic, isStatic, removeModifier, setExtendedModifiers, setModifiers, setVisibility
-
Methods inherited from interface spoon.reflect.declaration.CtNamedElement
getSimpleName
-
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
-
Methods inherited from interface spoon.reflect.declaration.CtTypedElement
getType
-
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 Detail
-
clone
CtAnonymousExecutable 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<Void>
- Specified by:
clone
in interfaceCtNamedElement
-
setSimpleName
<C extends CtNamedElement> C setSimpleName(String simpleName)
Description copied from interface:CtNamedElement
Sets the simple (unqualified) name of this element.- Specified by:
setSimpleName
in interfaceCtNamedElement
-
setThrownTypes
<T extends CtExecutable<Void>> T setThrownTypes(Set<CtTypeReference<? extends Throwable>> thrownTypes)
Description copied from interface:CtExecutable
Sets the thrown types.- Specified by:
setThrownTypes
in interfaceCtExecutable<Void>
-
setParameters
<T extends CtExecutable<Void>> T setParameters(List<CtParameter<?>> parameters)
Description copied from interface:CtExecutable
Sets the parameters.- Specified by:
setParameters
in interfaceCtExecutable<Void>
-
setType
<C extends CtTypedElement> C setType(CtTypeReference<Void> type)
Description copied from interface:CtTypedElement
Sets this element's type.- Specified by:
setType
in interfaceCtTypedElement<Void>
-
addParameter
<T extends CtExecutable<Void>> T addParameter(CtParameter<?> parameter)
Description copied from interface:CtExecutable
Add a parameter for this executable- Specified by:
addParameter
in interfaceCtExecutable<Void>
- Returns:
- true if this element changed as a result of the call
-
addThrownType
<T extends CtExecutable<Void>> T addThrownType(CtTypeReference<? extends Throwable> throwType)
Description copied from interface:CtExecutable
add a thrown type.- Specified by:
addThrownType
in interfaceCtExecutable<Void>
- Returns:
- true if this element changed as a result of the call
-
-