@Beta public interface MutableExecutableDeclaration extends MutableTypeParameterDeclarator, ExecutableDeclaration
| Modifier and Type | Method and Description |
|---|---|
MutableParameterDeclaration |
addParameter(java.lang.String name,
TypeReference type)
Adds a parameter
|
java.lang.Iterable<? extends MutableParameterDeclaration> |
getParameters() |
void |
setBody(CompilationStrategy compilationStrategy)
Sets the given
CompilationStrategy as the body. |
void |
setBody(Expression body)
Setting an expression will alter the scope of it accordingly.
|
void |
setBody(StringConcatenationClient compilationTemplate)
Sets the given
StringConcatenationClient as the body. |
void |
setExceptions(TypeReference... exceptions)
Sets the declared exceptions.
|
void |
setVarArgs(boolean isVarArgs) |
addTypeParameter, getTypeParametersgetDeclaringType, setDeprecated, setDocComment, setVisibilitymarkAsReadaddAnnotation, removeAnnotationsetSimpleNameremovegetBody, getExceptions, isVarArgsgetDocComment, getModifiers, getVisibility, isDeprecatedfindAnnotation, getAnnotationsgetCompilationUnit, getSimpleNamejava.lang.Iterable<? extends MutableParameterDeclaration> getParameters()
getParameters in interface ExecutableDeclarationvoid setVarArgs(boolean isVarArgs)
isVarArgs - whether the last argument is a var arg.void setBody(Expression body)
MutableExecutableDeclaration has already set
another expression or compilation strategy the old one will be detached.
If the given expression is already assigned to another MutableExecutableDeclaration or MutableFieldDeclaration
it will be automatically detached from it.body - the expression to set as the body of this executablevoid setBody(CompilationStrategy compilationStrategy)
CompilationStrategy as the body.
The given CompilationStrategy will be executed later during code generation, not immediately.
If this MutableExecutableDeclaration has already set another expression or compilation strategy the old one will be detached.compilationStrategy - the compilation strategy, must not be nulljava.lang.IllegalArgumentException - if compilationStrategy is nullvoid setBody(StringConcatenationClient compilationTemplate)
StringConcatenationClient as the body.
The given StringConcatenationClient will be executed later during code generation, not immediately.
If this MutableExecutableDeclaration has already set another expression or compilation strategy the old one will be detached.compilationTemplate - the compilation strategy, must not be nulljava.lang.IllegalArgumentException - if compilationStrategy is nullvoid setExceptions(TypeReference... exceptions)
exceptions - the declared exceptionsjava.lang.IllegalArgumentException - if the exceptions is null or contains nullMutableParameterDeclaration addParameter(java.lang.String name, TypeReference type)
name - the name of the parameter, must be a valid java identifiertype - the type of the parameter, must not be nulljava.lang.IllegalArgumentException - if the name is not a valid java identifier or the type is null