Package spoon.reflect.code
Interface CtExecutableReferenceExpression<T,E extends CtExpression<?>>
- Type Parameters:
T
- Each executable references are typed by an interface with one method. This generic type correspond to this concept.E
- Correspond ofType
inType::method
.
- All Superinterfaces:
Cloneable
,CtCodeElement
,CtElement
,CtExpression<T>
,CtQueryable
,CtTargetedExpression<T,E>
,CtTypedElement<T>
,CtVisitable
,FactoryAccessor
,Serializable
,SourcePositionHolder
,TemplateParameter<T>
- All Known Implementing Classes:
CtExecutableReferenceExpressionImpl
public interface CtExecutableReferenceExpression<T,E extends CtExpression<?>>
extends CtTargetedExpression<T,E>
This abstract code element defines an expression which represents an executable reference.
* Example:
java.util.function.Supplier p = Object::new;
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone the element which calls this method in a new object.Gets the executable referenced by the expression.<C extends CtExecutableReferenceExpression<T, E>>
CsetExecutable(CtExecutableReference<T> executable)
Sets the executable will be referenced by the expression.Methods inherited from interface spoon.reflect.code.CtCodeElement
partiallyEvaluate
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.code.CtExpression
addTypeCast, getTypeCasts, setTypeCasts
Methods inherited from interface spoon.reflect.visitor.chain.CtQueryable
filterChildren, map, map
Methods inherited from interface spoon.reflect.code.CtTargetedExpression
getTarget, setTarget
Methods inherited from interface spoon.reflect.declaration.CtTypedElement
getType, setType
Methods inherited from interface spoon.reflect.visitor.CtVisitable
accept
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
Methods inherited from interface spoon.template.TemplateParameter
S
-
Method Details
-
getExecutable
CtExecutableReference<T> getExecutable()Gets the executable referenced by the expression. -
setExecutable
<C extends CtExecutableReferenceExpression<T, E>> C setExecutable(CtExecutableReference<T> executable)Sets the executable will be referenced by the expression. -
clone
CtExecutableReferenceExpression<T,E> 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 interfaceCtCodeElement
- Specified by:
clone
in interfaceCtElement
- Specified by:
clone
in interfaceCtExpression<T>
- Specified by:
clone
in interfaceCtTargetedExpression<T,E extends CtExpression<?>>
-