Uses of Interface
spoon.template.Template
Packages that use 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
Methods in spoon.support.template with parameters of type TemplateModifier 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 ObjectGets a template field parameter value.static voidSets a template field parameter value.Method parameters in spoon.support.template with type arguments of type TemplateModifier 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
Classes in spoon.template that implement TemplateModifier and TypeClassDescriptionclassAbstractTemplate<T extends CtElement>handles the well-formedness and helper methods of templatesclassThis class represents a template parameter that defines a void block statement directly expressed in Java (no returns).classThis class represents an expression template parameter expressed in Java.classInserts 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.classThis class represents a template parameter that defines a statement list directly expressed in Java (no returns).Methods in spoon.template with type parameters of type TemplateModifier 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.Methods in spoon.template with parameters of type TemplateModifier and TypeMethodDescriptionstatic <T> CtClass<T>Substitution.getTemplateCtClass(Factory factory, Template<?> template)static voidSubstitution.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 voidSubstitution.insertAllFields(CtType<?> targetType, Template<?> template)Inserts all the fields from a given template by substituting all the template parameters by their values.static voidSubstitution.insertAllMethods(CtType<?> targetType, Template<?> template)Inserts all the methods from a given template by substituting all the template parameters by their values.static voidSubstitution.insertAllNestedTypes(CtType<?> targetType, Template<?> template)Inserts all the nested types from a given template by substituting all the template parameters by their values.static voidSubstitution.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 CtStatementSubstitution.substituteStatement(CtClass<?> targetClass, Template<?> template, int statementIndex, String executableName, CtTypeReference<?>... parameterTypes)Gets a statement from a template executable with all the template parameters substituted.