public interface CtExecutableReference<T> extends CtReference, CtActualTypeContainer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONSTRUCTOR_NAME |
static java.lang.String |
LAMBDA_NAME_PREFIX |
static java.lang.String |
UNKNOWN_TYPE |
Modifier and Type | Method and Description |
---|---|
CtExecutableReference<T> |
clone()
Clone the element which calls this method in a new object.
|
java.lang.reflect.Constructor<?> |
getActualConstructor()
Gets the runtime constructor that corresponds to an executable reference
if any.
|
java.lang.reflect.Method |
getActualMethod()
Gets the runtime method that corresponds to an executable reference if
any.
|
CtExecutable<T> |
getDeclaration()
Returns the declaration that corresponds to the referenced element only
if the declaration is in the analyzed source files.
|
CtTypeReference<?> |
getDeclaringType()
Gets the reference to the type that declares this executable.
|
CtExecutable<T> |
getExecutableDeclaration()
Returns a subtype
CtExecutable that corresponds to the reference
even if its declaring type isn't in the Spoon source path (in this case,
the Spoon elements are built with runtime reflection). |
CtExecutableReference<?> |
getOverridingExecutable()
Returns the method overridden by this one, if exists (null otherwise).
|
<S extends T> |
getOverridingExecutable(CtTypeReference<?> subType)
Gets an overriding executable for this executable from a given subtype,
if exists.
|
java.util.List<CtTypeReference<?>> |
getParameters()
Gets parameters of the executable.
|
java.lang.String |
getSignature()
Gets the signature of this method or constructor, as explained in
CtExecutable.getSignature() . |
CtTypeReference<T> |
getType()
For methods, gets the return type of the executable (may be null in noclasspath mode).
|
boolean |
isConstructor()
Tells if this is a reference to a constructor.
|
boolean |
isFinal()
Tells if the referenced executable is final.
|
boolean |
isOverriding(CtExecutableReference<?> executable)
Returns
true if this executable overrides the given
executable. |
boolean |
isStatic()
Tells if the referenced executable is static.
|
<C extends CtExecutableReference<T>> |
setDeclaringType(CtTypeReference<?> declaringType)
Sets the declaring type.
|
<C extends CtExecutableReference<T>> |
setParameters(java.util.List<CtTypeReference<?>> parameters)
Sets parameters of the executable.
|
<C extends CtExecutableReference<T>> |
setStatic(boolean b)
Sets this executable reference to be static or not.
|
<C extends CtExecutableReference<T>> |
setType(CtTypeReference<T> type)
Sets the type of the variable.
|
getSimpleName, setComments, 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, setDocComment, setImplicit, setParent, setPosition, setPositions, setValueByRole, toString, toStringDebug, updateAllParentsBelow
getFactory, setFactory
accept
filterChildren, map, map
addActualTypeArgument, getActualTypeArguments, removeActualTypeArgument, setActualTypeArguments
static final java.lang.String CONSTRUCTOR_NAME
static final java.lang.String LAMBDA_NAME_PREFIX
static final java.lang.String UNKNOWN_TYPE
boolean isConstructor()
java.lang.reflect.Method getActualMethod()
java.lang.reflect.Constructor<?> getActualConstructor()
CtExecutable<T> getDeclaration()
CtReference
CtTypeReference.getTypeDeclaration()
and getExecutableDeclaration()
that never return null.getDeclaration
in interface CtReference
CtExecutable<T> getExecutableDeclaration()
CtExecutable
that corresponds to the reference
even if its declaring type isn't in the Spoon source path (in this case,
the Spoon elements are built with runtime reflection).CtTypeReference<?> getDeclaringType()
CtTypeReference<T> getType()
java.util.List<CtTypeReference<?>> getParameters()
<C extends CtExecutableReference<T>> C setParameters(java.util.List<CtTypeReference<?>> parameters)
boolean isOverriding(CtExecutableReference<?> executable)
true
if this executable overrides the given
executable.CtExecutableReference<?> getOverridingExecutable()
<S extends T> CtExecutableReference<S> getOverridingExecutable(CtTypeReference<?> subType)
S
- subtype of TsubType
- starting bottom type to find an overriding executable
(subtypes are not tested)boolean isStatic()
<C extends CtExecutableReference<T>> C setDeclaringType(CtTypeReference<?> declaringType)
<C extends CtExecutableReference<T>> C setStatic(boolean b)
<C extends CtExecutableReference<T>> C setType(CtTypeReference<T> type)
boolean isFinal()
java.lang.String getSignature()
CtExecutable.getSignature()
.CtExecutableReference<T> clone()
CtElement
Refactoring.copyType(CtType)
and Refactoring.copyMethod(CtMethod)
instead which does additional work beyond cloning.clone
in interface CtElement
clone
in interface CtReference
Copyright © 2007–2021 Inria. All rights reserved.