Package spoon.template
Class AbstractTemplate<T extends CtElement>
- java.lang.Object
-
- spoon.template.AbstractTemplate<T>
-
- All Implemented Interfaces:
Template<T>
- Direct Known Subclasses:
BlockTemplate
,ExpressionTemplate
,ExtensionTemplate
,StatementTemplate
public abstract class AbstractTemplate<T extends CtElement> extends Object implements Template<T>
handles the well-formedness and helper methods of templates
-
-
Constructor Summary
Constructors Constructor Description AbstractTemplate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractTemplate<T>
addGeneratedBy(boolean addGeneratedBy)
Factory
getFactory()
returns a Spoon factory object from the first template parameter that contains oneboolean
isAddGeneratedBy()
boolean
isValid()
verifies whether all template parameters are filled.boolean
isWellFormed()
verifies whether there is at least one template parameter.boolean
withPartialEvaluation()
if true, the result of the template evaluation is simplified with partial evaluation
-
-
-
Method Detail
-
withPartialEvaluation
public boolean withPartialEvaluation()
Description copied from interface:Template
if true, the result of the template evaluation is simplified with partial evaluation- Specified by:
withPartialEvaluation
in interfaceTemplate<T extends CtElement>
-
isWellFormed
public boolean isWellFormed()
verifies whether there is at least one template parameter.
-
isValid
public boolean isValid()
verifies whether all template parameters are filled.
-
getFactory
public Factory getFactory()
returns a Spoon factory object from the first template parameter that contains one
-
isAddGeneratedBy
public boolean isAddGeneratedBy()
- Returns:
- true if the template engine adds Generated by ... comments into generated code
-
addGeneratedBy
public AbstractTemplate<T> addGeneratedBy(boolean addGeneratedBy)
- Parameters:
addGeneratedBy
- if true the template engine will add Generated by ... comments into generated code
-
-