Top Methods
org.eclipse.xtend.lib.macro.declaration

public Interface MutableExecutableDeclaration

extends MutableTypeParameterDeclarator, ExecutableDeclaration
Known Direct Subinterfaces
org.eclipse.xtend.lib.macro.declaration.MutableMethodDeclaration, org.eclipse.xtend.lib.macro.declaration.MutableConstructorDeclaration
Annotations
@Beta
Imports
org.eclipse.xtend.lib.macro.expression.Expression, org.eclipse.xtend2.lib.StringConcatenationClient, com.google.common.annotations.Beta

Author
Sven Efftinge

Method Summary

Modifier and TypeMethod and Description
public MutableParameterDeclaration

Returns:

the created parameter
addParameter
(String
the name of the parameter, must be a valid java identifier
name
,
TypeReference
the type of the parameter, must not be null
type
)

Adds a parameter

public MutableParameterDeclaration

Returns:

the created parameter
addParameter
(int position, String
the name of the parameter, must be a valid java identifier
name
,
TypeReference
the type of the parameter, must not be null
type
)

Inserts a parameter at the specified position in the parameter list

public Iterable<? extends MutableParameterDeclaration>
public void
setBody(Expression
the expression to set as the body of this executable
body
)

Setting an expression will alter the scope of it accordingly.

public void
setBody(CompilationStrategy
the compilation strategy, must not be null
compilationStrategy
)

Sets the given CompilationStrategy as the body.

public void
setBody(StringConcatenationClient
the compilation strategy, must not be null
compilationTemplate
)

Sets the given StringConcatenationClient as the body.

public void
setExceptions(TypeReference...
the declared exceptions
exceptions
)

Sets the declared exceptions.

public void
setVarArgs(boolean
whether the last argument is a var arg.
isVarArgs
)

Inherited from org.eclipse.xtend.lib.macro.declaration.ExecutableDeclaration:
getBodygetExceptionsisVarArgs
Inherited from org.eclipse.xtend.lib.macro.declaration.MutableTypeParameterDeclarator:
addTypeParametergetTypeParameters

Method Detail

addParameterback to summary
public MutableParameterDeclaration addParameter(String name, TypeReference type)

Adds a parameter

Parameters
name:String

the name of the parameter, must be a valid java identifier

type:TypeReference

the type of the parameter, must not be null

Returns:MutableParameterDeclaration

the created parameter

Exceptions
IllegalArgumentException:
if the name is not a valid java identifier or the type is null
addParameterback to summary
public MutableParameterDeclaration addParameter(int position, String name, TypeReference type)

Inserts a parameter at the specified position in the parameter list

Parameters
name:String

the name of the parameter, must be a valid java identifier

type:TypeReference

the type of the parameter, must not be null

Returns:MutableParameterDeclaration

the created parameter

Exceptions
IllegalArgumentException:
if the name is not a valid java identifier or the type is null
IndexOutOfBoundsException:
if the index is out of range (index < 0 || index > parameters.size())
getParametersback to summary
public Iterable<? extends MutableParameterDeclaration> getParameters()

Redeclares org.eclipse.xtend.lib.macro.declaration.ExecutableDeclaration.getParameters.

setBodyback to summary
public void setBody(Expression body)

Setting an expression will alter the scope of it accordingly. Each expression can only be assigned to one element, if this 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.

Parameters
body:Expression

the expression to set as the body of this executable

setBodyback to summary
public void setBody(CompilationStrategy compilationStrategy)

Sets the given 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.

Parameters
compilationStrategy:CompilationStrategy

the compilation strategy, must not be null

Exceptions
IllegalArgumentException:
if compilationStrategy is null
setBodyback to summary
public void setBody(StringConcatenationClient compilationTemplate)

Sets the given 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.

Parameters
compilationTemplate:StringConcatenationClient

the compilation strategy, must not be null

Exceptions
IllegalArgumentException:
if compilationStrategy is null
setExceptionsback to summary
public void setExceptions(TypeReference... exceptions)

Sets the declared exceptions.

Parameters
exceptions:TypeReference[]

the declared exceptions

Exceptions
IllegalArgumentException:
if the exceptions is null or contains null
setVarArgsback to summary
public void setVarArgs(boolean isVarArgs)
Parameters
isVarArgs:boolean

whether the last argument is a var arg.