Package spoon.template
This package defines a framework for well-typed pure-Java templates.
A template is a regular Java class that implements the Template
interface and
that contains some template parameters.
Related Documentation
-
Interface Summary Interface Description Template<T extends CtElement> A template code is simply a piece of code that uses aTemplateParameter
's instance.TemplateParameter<T> This interface defines a typed template parameter. -
Class Summary Class Description AbstractTemplate<T extends CtElement> handles the well-formedness and helper methods of templatesBlockTemplate This class represents a template parameter that defines a void block statement directly expressed in Java (no returns).ExpressionTemplate<T> This class represents an expression template parameter expressed in Java.ExtensionTemplate Inserts all the methods, fields, constructors, initialization blocks (if target is a class), inner types, and super interfaces (exceptTemplate
) from a given template by substituting all the template parameters by their values.StatementTemplate This class represents a template parameter that defines a statement list directly expressed in Java (no returns).Substitution This class defines the substitution API for templates (seeTemplate
).TemplateMatcher This class defines an engine for matching a template to pieces of code. -
Exception Summary Exception Description TemplateException This runtime exception can be throws when something wrong occurs in template operations such as loading, substitution, and matching. -
Annotation Types Summary Annotation Type Description Local This annotation should be placed on templates' members to indicate that they are local elements of the template class.Parameter This annotation should be placed on templates' fields or methods to indicate that they represent template parameters.