Uses of Interface
spoon.template.Template
Package
Description
This package defines the substitution and matching engines for Java templates.
This package defines a framework for well-typed pure-Java templates.
-
Uses of Template in spoon.support.template
Modifier and TypeMethodDescriptionParameters.getNamesToValues(Template<?> template, CtClass<? extends Template<?>> templateType)
Gets the Map of names to template parameter value for all the template parameters of a given template type (including the ones defined by the super types).Parameters.getTemplateParametersAsMap(Factory f, Template<?> template)
Gets the Map of names to template parameter values for all the template parameters of a given template type + adds mapping of template model reference to target type as parameter toostatic Object
Gets a template field parameter value.static void
Sets a template field parameter value.Modifier and TypeMethodDescriptionParameters.getAllTemplateParameterFields(Class<? extends Template<?>> clazz, Factory factory)
returns all the compile_time fields of a template representing a template parameterParameters.getAllTemplateParameterFields(Class<? extends Template> clazz)
returns all the runtime fields of a template representing a template parameterGets the names of all the template parameters of a given template type (including the ones defined by the super types).Parameters.getNamesToValues(Template<?> template, CtClass<? extends Template<?>> templateType)
Gets the Map of names to template parameter value for all the template parameters of a given template type (including the ones defined by the super types).static CtField<?>
Parameters.getParameterField(CtClass<? extends Template<?>> templateClass, String parameterName)
-
Uses of Template in spoon.template
Modifier and TypeClassDescriptionclass
AbstractTemplate<T extends CtElement>
handles the well-formedness and helper methods of templatesclass
This class represents a template parameter that defines a void block statement directly expressed in Java (no returns).class
This class represents an expression template parameter expressed in Java.class
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.class
This class represents a template parameter that defines a statement list directly expressed in Java (no returns).Modifier and TypeMethodDescriptionstatic <T extends Template<?>>
voidInserts 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.Modifier and TypeMethodDescriptionstatic <T> CtClass<T>
Substitution.getTemplateCtClass(Factory factory, Template<?> template)
static void
Substitution.insertAllConstructors(CtType<?> targetType, Template<?> template)
Inserts all constructors and initialization blocks from a given template by substituting all the template parameters by their values.static void
Substitution.insertAllFields(CtType<?> targetType, Template<?> template)
Inserts all the fields from a given template by substituting all the template parameters by their values.static void
Substitution.insertAllMethods(CtType<?> targetType, Template<?> template)
Inserts all the methods from a given template by substituting all the template parameters by their values.static void
Substitution.insertAllNestedTypes(CtType<?> targetType, Template<?> template)
Inserts all the nested types from a given template by substituting all the template parameters by their values.static void
Substitution.insertAllSuperInterfaces(CtType<?> targetType, Template<?> template)
Inserts all the super interfaces (exceptTemplate
) from a given template by substituting all the template parameters by their values.static <T> CtConstructor<T>
Substitution.insertConstructor(CtClass<T> targetClass, Template<?> template, CtConstructor<?> sourceConstructor)
Generates a constructor from a template constructor by substituting all the template parameters by their values.static <T> CtConstructor<T>
Substitution.insertConstructor(CtClass<T> targetClass, Template<?> template, CtMethod<?> sourceMethod)
Generates a constructor from a template method by substituting all the template parameters by their values.static <T> CtField<T>
Substitution.insertField(CtType<?> targetType, Template<?> template, CtField<T> sourceField)
Generates a field (and its initialization expression) from a template field by substituting all the template parameters by their values.static <T> CtMethod<T>
Substitution.insertMethod(CtType<?> targetType, Template<?> template, CtMethod<T> sourceMethod)
Generates a method from a template method by substituting all the template parameters by their values.static <E extends CtElement>
ESubstitution.substitute(CtType<?> targetType, Template<?> template, E code)
Substitutes all the template parameters in a random piece of code.static <T extends CtType<?>>
TSubstitution.substitute(Template<?> template, T templateType)
Substitutes all the template parameters in a given template type and returns the resulting type.static CtExpression<?>
Substitution.substituteFieldDefaultExpression(CtType<?> targetType, Template<?> template, String fieldName)
Gets a default expression from a template field with all the template parameters substituted.static CtBlock<?>
Substitution.substituteMethodBody(CtClass<?> targetClass, Template<?> template, String executableName, CtTypeReference<?>... parameterTypes)
Gets a body from a template executable with all the template parameters substituted.static CtStatement
Substitution.substituteStatement(CtClass<?> targetClass, Template<?> template, int statementIndex, String executableName, CtTypeReference<?>... parameterTypes)
Gets a statement from a template executable with all the template parameters substituted.