spoon.reflect.code.CtAbstractInvocation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spoon-core Show documentation
Show all versions of spoon-core Show documentation
Spoon is a tool for meta-programming, analysis and transformation of Java programs.
/*
* SPDX-License-Identifier: (MIT OR CECILL-C)
*
* Copyright (C) 2006-2023 INRIA and contributors
*
* Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon.
*/
package spoon.reflect.code;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.reference.CtExecutableReference;
import spoon.reflect.annotations.PropertyGetter;
import spoon.reflect.annotations.PropertySetter;
import java.util.List;
import static spoon.reflect.path.CtRole.ARGUMENT;
import static spoon.reflect.path.CtRole.EXECUTABLE_REF;
/**
* This code element defines an abstract invocation on a
* {@link spoon.reflect.declaration.CtExecutable}.
*
* @param
* Return type of this invocation
*/
public interface CtAbstractInvocation extends CtElement {
/**
* The arguments of the invocation.
*
* @return the expressions that define the values of the arguments
*/
@PropertyGetter(role = ARGUMENT)
List> getArguments();
/**
* Adds an argument expression to the invocation.
*/
@PropertySetter(role = ARGUMENT)
> C addArgument(CtExpression> argument);
/**
* Adds an argument expression to the invocation at the specified position.
*
* @param position position to add the argument at.
* @param argument argument to add.
* @return the receiver.
*/
@PropertySetter(role = ARGUMENT)
> C addArgumentAt(int position, CtExpression> argument);
/**
* Removes an argument expression from the invocation.
*/
@PropertySetter(role = ARGUMENT)
void removeArgument(CtExpression> argument);
/**
* Sets the invocation's arguments.
*/
@PropertySetter(role = ARGUMENT)
> C setArguments(List> arguments);
/**
* Returns the invoked executable.
*/
@PropertyGetter(role = EXECUTABLE_REF)
CtExecutableReference getExecutable();
/**
* Sets the invoked executable.
*/
@PropertySetter(role = EXECUTABLE_REF)
> C setExecutable(CtExecutableReference executable);
}