Class TemplateManager

java.lang.Object
scriptella.tools.template.TemplateManager
Direct Known Subclasses:
DataMigrator

public class TemplateManager extends Object
ETL files template manager.
Version:
1.0
Author:
Fyodor Kupolov
  • Field Details

  • Constructor Details

    • TemplateManager

      public TemplateManager()
  • Method Details

    • create

      public void create(Map<String,?> properties) throws IOException
      Produce template files.
      Parameters:
      properties - configuration properties.
      Throws:
      IOException - if output fails.
    • loadResourceAsString

      protected String loadResourceAsString(String resourcePath) throws IOException
      Loads specifed classpath resource into a string.
      Parameters:
      resourcePath - path to resource.
      Returns:
      loaded resource.
      Throws:
      IOException - if IO error occurs.
    • defineName

      protected String defineName()
      Defines base name for ETL.
    • newFileWriter

      protected Writer newFileWriter(String fileName) throws IOException
      Template factory method for writers.
      Throws:
      IOException
    • checkFile

      protected boolean checkFile(String name)
      Returns true if file doesn't exist.
      Parameters:
      name - file name.
    • create

      public static void create(String name, String propertiesFile) throws IOException
      Creates an ETL template using a specified template manager name and properties file.
      Parameters:
      name - etl template name.
      propertiesFile - configuration properties file.
      Throws:
      IOException - if I/O error occurs.
    • forName

      public static TemplateManager forName(String name)
      Loads a specified by name.
      Parameters:
      name - template name. Cannot be null.
      Returns:
      loaded template manager.