Package spoon.support.reflect.code
Class CtInvocationImpl<T>
java.lang.Object
spoon.support.reflect.declaration.CtElementImpl
spoon.support.reflect.code.CtCodeElementImpl
spoon.support.reflect.code.CtExpressionImpl<E>
spoon.support.reflect.code.CtTargetedExpressionImpl<T,CtExpression<?>>
spoon.support.reflect.code.CtInvocationImpl<T>
- All Implemented Interfaces:
Serializable
,Cloneable
,FactoryAccessor
,CtAbstractInvocation<T>
,CtCodeElement
,CtExpression<T>
,CtInvocation<T>
,CtStatement
,CtTargetedExpression<T,CtExpression<?>>
,SourcePositionHolder
,CtElement
,CtTypedElement<T>
,CtActualTypeContainer
,CtQueryable
,CtVisitable
,TemplateParameter<T>
public class CtInvocationImpl<T>
extends CtTargetedExpressionImpl<T,CtExpression<?>>
implements CtInvocation<T>
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class spoon.support.reflect.declaration.CtElementImpl
ERROR_MESSAGE_TO_STRING, factory, LOGGER, parent
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Accepts a visitor<T extends CtActualTypeContainer>
TaddActualTypeArgument(CtTypeReference<?> actualTypeArgument)
Delegate to the executable reference of the invocation.<C extends CtAbstractInvocation<T>>
CaddArgument(CtExpression<?> argument)
Adds an argument expression to the invocation.<C extends CtAbstractInvocation<T>>
CaddArgumentAt(int position, CtExpression<?> argument)
Adds an argument expression to the invocation at the specified position.clone()
Clone the element which calls this method in a new object.List<CtTypeReference<?>>
Delegate to the executable reference of the invocation.List<CtExpression<?>>
The arguments of the invocation.Returns the invoked executable.getLabel()
Gets the label of this statement if defined.getType()
Gets this element's type.<C extends CtStatement>
CinsertAfter(CtStatement statement)
Inserts a statement after the current statement.<C extends CtStatement>
CinsertAfter(CtStatementList statements)
Inserts a statement list before the current statement.<C extends CtStatement>
CinsertBefore(CtStatement statement)
Inserts a statement given as parameter before the current statement (this).<C extends CtStatement>
CinsertBefore(CtStatementList statements)
Inserts a statement list before the current statement.boolean
removeActualTypeArgument(CtTypeReference<?> actualTypeArgument)
Removes a type argument.void
removeArgument(CtExpression<?> argument)
Removes an argument expression from the invocation.<T extends CtActualTypeContainer>
TsetActualTypeArguments(List<? extends CtTypeReference<?>> actualTypeArguments)
Delegate to the executable reference of the invocation.<C extends CtAbstractInvocation<T>>
CsetArguments(List<CtExpression<?>> arguments)
Sets the invocation's arguments.<C extends CtAbstractInvocation<T>>
CsetExecutable(CtExecutableReference<T> executable)
Sets the invoked executable.<C extends CtStatement>
CSets the label of this statement.<C extends CtTypedElement>
CsetType(CtTypeReference type)
Sets this element's type.Methods inherited from class spoon.support.reflect.code.CtTargetedExpressionImpl
getTarget, setTarget
Methods inherited from class spoon.support.reflect.code.CtExpressionImpl
addTypeCast, getTypeCasts, S, setTypeCasts
Methods inherited from class spoon.support.reflect.code.CtCodeElementImpl
partiallyEvaluate
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.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.CtStatement
comment
Methods inherited from interface spoon.reflect.code.CtTargetedExpression
getTarget, setTarget
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
Methods inherited from interface spoon.template.TemplateParameter
S
-
Constructor Details
-
CtInvocationImpl
public CtInvocationImpl()
-
-
Method Details
-
accept
Description copied from interface:CtVisitable
Accepts a visitor- Specified by:
accept
in interfaceCtVisitable
-
getArguments
Description copied from interface:CtAbstractInvocation
The arguments of the invocation.- Specified by:
getArguments
in interfaceCtAbstractInvocation<T>
- Returns:
- the expressions that define the values of the arguments
-
addArgument
Description copied from interface:CtAbstractInvocation
Adds an argument expression to the invocation.- Specified by:
addArgument
in interfaceCtAbstractInvocation<T>
-
addArgumentAt
Description copied from interface:CtAbstractInvocation
Adds an argument expression to the invocation at the specified position.- Specified by:
addArgumentAt
in interfaceCtAbstractInvocation<T>
- Parameters:
position
- position to add the argument at.argument
- argument to add.- Returns:
- the receiver.
-
removeArgument
Description copied from interface:CtAbstractInvocation
Removes an argument expression from the invocation.- Specified by:
removeArgument
in interfaceCtAbstractInvocation<T>
-
getExecutable
Description copied from interface:CtAbstractInvocation
Returns the invoked executable.- Specified by:
getExecutable
in interfaceCtAbstractInvocation<T>
-
insertAfter
Description copied from interface:CtStatement
Inserts a statement after the current statement.- Specified by:
insertAfter
in interfaceCtStatement
-
insertBefore
Description copied from interface:CtStatement
Inserts a statement given as parameter before the current statement (this).- Specified by:
insertBefore
in interfaceCtStatement
-
insertAfter
Description copied from interface:CtStatement
Inserts a statement list before the current statement.- Specified by:
insertAfter
in interfaceCtStatement
-
insertBefore
Description copied from interface:CtStatement
Inserts a statement list before the current statement.- Specified by:
insertBefore
in interfaceCtStatement
-
setArguments
Description copied from interface:CtAbstractInvocation
Sets the invocation's arguments.- Specified by:
setArguments
in interfaceCtAbstractInvocation<T>
-
setExecutable
Description copied from interface:CtAbstractInvocation
Sets the invoked executable.- Specified by:
setExecutable
in interfaceCtAbstractInvocation<T>
-
getLabel
Description copied from interface:CtStatement
Gets the label of this statement if defined.- Specified by:
getLabel
in interfaceCtStatement
- Returns:
- the label's name (null if undefined)
-
setLabel
Description copied from interface:CtStatement
Sets the label of this statement.- Specified by:
setLabel
in interfaceCtStatement
-
getType
Description copied from interface:CtTypedElement
Gets this element's type.- Specified by:
getType
in interfaceCtInvocation<T>
- Specified by:
getType
in interfaceCtTypedElement<T>
- Overrides:
getType
in classCtExpressionImpl<T>
-
setType
Description copied from interface:CtTypedElement
Sets this element's type.- Specified by:
setType
in interfaceCtTypedElement<T>
- Overrides:
setType
in classCtExpressionImpl<T>
-
getActualTypeArguments
Description copied from interface:CtInvocation
Delegate to the executable reference of the invocation.- Specified by:
getActualTypeArguments
in interfaceCtActualTypeContainer
- Specified by:
getActualTypeArguments
in interfaceCtInvocation<T>
- See Also:
CtActualTypeContainer.getActualTypeArguments()
-
setActualTypeArguments
public <T extends CtActualTypeContainer> T setActualTypeArguments(List<? extends CtTypeReference<?>> actualTypeArguments)Description copied from interface:CtInvocation
Delegate to the executable reference of the invocation.- Specified by:
setActualTypeArguments
in interfaceCtActualTypeContainer
- Specified by:
setActualTypeArguments
in interfaceCtInvocation<T>
- See Also:
CtActualTypeContainer.getActualTypeArguments()
-
addActualTypeArgument
public <T extends CtActualTypeContainer> T addActualTypeArgument(CtTypeReference<?> actualTypeArgument)Description copied from interface:CtInvocation
Delegate to the executable reference of the invocation.- Specified by:
addActualTypeArgument
in interfaceCtActualTypeContainer
- Specified by:
addActualTypeArgument
in interfaceCtInvocation<T>
- See Also:
CtActualTypeContainer.getActualTypeArguments()
-
removeActualTypeArgument
Description copied from interface:CtActualTypeContainer
Removes a type argument.- Specified by:
removeActualTypeArgument
in interfaceCtActualTypeContainer
-
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 interfaceCtInvocation<T>
- Specified by:
clone
in interfaceCtStatement
- Specified by:
clone
in interfaceCtTargetedExpression<T,CtExpression<?>>
- Overrides:
clone
in classCtTargetedExpressionImpl<T,CtExpression<?>>
-