public interface CtMethod<T> extends CtExecutable<T>, CtTypeMember, CtFormalTypeDeclarer, CtShadowable
EXECUTABLE_SEPARATOR
Modifier and Type | Method and Description |
---|---|
CtMethod<T> |
clone()
Clone the element which calls this method in a new object.
|
CtMethod<?> |
copyMethod()
Copy the method, where copy means cloning + porting all the references of the old method to the new method (important for recursive methods).
|
java.util.Collection<CtMethod<?>> |
getTopDefinitions()
Returns the top-most methods in the hierarchy defining this method
(in super class and super interfaces).
|
boolean |
isDefaultMethod()
Checks if the method is a default method.
|
boolean |
isOverriding(CtMethod<?> superMethod) |
<C extends CtMethod<T>> |
setDefaultMethod(boolean defaultMethod)
Sets the default value state of a method.
|
addParameter, addThrownType, getBody, getParameters, getReference, getSignature, getThrownTypes, removeParameter, removeThrownType, setParameters, setThrownTypes
getType, setType
setBody
addFormalCtTypeParameter, getFormalCtTypeParameters, removeFormalCtTypeParameter, setFormalCtTypeParameters
getDeclaringType, getTopLevelType
addModifier, getExtendedModifiers, getModifiers, getVisibility, hasModifier, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, removeModifier, setExtendedModifiers, setModifiers, setVisibility
getSimpleName, setSimpleName
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
getFactory, setFactory
accept
filterChildren, map, map
isShadow, setShadow
boolean isOverriding(CtMethod<?> superMethod)
superMethod
- to be checked methodassertTrue(this.isOverriding(this))
boolean isDefaultMethod()
<C extends CtMethod<T>> C setDefaultMethod(boolean defaultMethod)
CtMethod<T> clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtElement
clone
in interface CtExecutable<T>
clone
in interface CtNamedElement
java.util.Collection<CtMethod<?>> getTopDefinitions()
CtMethod<?> copyMethod()
Refactoring.changeMethodName(CtMethod, String)
(and not CtNamedElement.setSimpleName(String)
, which does not update the references)Copyright © 2007–2021 Inria. All rights reserved.