Class GeneratorEngine

java.lang.Object
de.monticore.generating.GeneratorEngine

public class GeneratorEngine extends Object
Represents the whole generator engine component. Clients usually need only this class when generating.
  • Field Details

  • Constructor Details

  • Method Details

    • generate

      public void generate(String templateName, Path filePath, ASTNode node, Object... templateArguments)
      Processes the template templateName with the node and the given templateArguments and writes the content into the filePath. Note: Unless not absolute, the filePath is relative to the configured output directory specified in the GeneratorSetup.
      Parameters:
      templateName - the template to be processes
      filePath - the file path in which the content is to be written
      node - the ast node
      templateArguments - additional template arguments (if needed).
    • generateNoA

      public void generateNoA(String templateName, Path filePath, Object... templateArguments)
      Processes the template templateName with the node and the given templateArguments and writes the content into the filePath. Note: Unless not absolute, the filePath is relative to the configured output directory specified in the GeneratorSetup.
      Parameters:
      templateName - the template to be processes
      filePath - the file path in which the content is to be written
      templateArguments - additional template arguments (if needed).
    • generate

      public void generate(String templateName, Writer writer, ASTNode node, Object... templateArguments)
      Processes the template templateName with the node and the given templateArguments and writes the content into the filePath. Note: Unless not absolute, the filePath is relative to the configured output directory specified in the GeneratorSetup.
      Parameters:
      templateName - the template to be processes
      writer - the writer in which the content is to be written
      node - the ast node
      templateArguments - additional template arguments (if needed).
    • generateNoA

      public void generateNoA(String templateName, Writer writer, Object... templateArguments)
      Processes the template templateName with the node and the given templateArguments and writes the content into the filePath. Note: Unless not absolute, the filePath is relative to the configured output directory specified in the GeneratorSetup.
      Parameters:
      templateName - the template to be processes
      writer - the writer in which the content is to be written
      templateArguments - additional template arguments (if needed).
    • generate

      public StringBuilder generate(String templateName, ASTNode node, Object... templateArguments)
      Processes the template templateName with the given templateArguments and returns the content as StringBuilder.
      Parameters:
      templateName - the template to be processes
      node - the ast node
      templateArguments - additional template arguments (if needed).
    • generateNoA

      public StringBuilder generateNoA(String templateName, Object... templateArguments)
      Processes the template templateName with the given templateArguments and returns the content as StringBuilder.
      Parameters:
      templateName - the template to be processes
      templateArguments - additional template arguments (if needed).
    • existsHandwrittenClass

      public static boolean existsHandwrittenClass(MCPath targetPath, String qualifiedName)
      Check whewther an handwritten version of that class already exits and shall be integrated (e.g. to apply TOP mechanism)