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 Details

    • AbstractTemplate

      public AbstractTemplate()
  • Method Details

    • 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 interface Template<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