Package spoon.template
Class StatementTemplate
- All Implemented Interfaces:
Template<CtStatement>
This class represents a template parameter that defines a statement list
directly expressed in Java (no returns).
To define a new statement list template parameter, you must subclass this
class and implement the statement()
method, which actually defines
the Java statements. It corresponds to a
CtStatementList
.
-
Constructor Summary
-
Method Summary
Methods inherited from class spoon.template.AbstractTemplate
addGeneratedBy, getFactory, isAddGeneratedBy, isValid, isWellFormed, withPartialEvaluation
-
Constructor Details
-
StatementTemplate
public StatementTemplate()Creates a new statement list template parameter.
-
-
Method Details
-
apply
Description copied from interface:Template
Returns the code which results from applying the template.- Parameters:
targetType
- the type that defines the context of the substitution. It may be null for templates with no context.
-
S
-
statement
This method must be implemented to define the template statement list.- Throws:
Throwable
-