Class FileGeneratorStringTemplate

    • Constructor Summary

      Constructors 
      Constructor Description
      FileGeneratorStringTemplate​(java.lang.String outputFile, java.lang.String[] templateGroupFiles, StringTemplateBuilder templateBuilder)
      Constructs a code generator parameterized with a hierarchy template groups, with a builder that will initialize the code template and with the full name to the target output file.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generate()
      Generates the target file.
      static void generateFile​(java.lang.String fileName, java.lang.String[] templateGroups, StringTemplateBuilder templateBuilder)
      Generates a file by the specified template.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileGeneratorStringTemplate

        public FileGeneratorStringTemplate​(java.lang.String outputFile,
                                           java.lang.String[] templateGroupFiles,
                                           StringTemplateBuilder templateBuilder)
        Constructs a code generator parameterized with a hierarchy template groups, with a builder that will initialize the code template and with the full name to the target output file.
        Parameters:
        outputFile - The full name of the target output file.
        templateGroupFiles - List of template group files. Important: the order is from the root of the hierarchy to child groups.
        templateBuilder - Builder that is responsible for initialization of the template.
    • Method Detail

      • generateFile

        public static void generateFile​(java.lang.String fileName,
                                        java.lang.String[] templateGroups,
                                        StringTemplateBuilder templateBuilder)
        Generates a file by the specified template.
        Parameters:
        fileName - Full name of the generated file.
        templateGroups - List of template group files.
        templateBuilder - Builder responsible for initialization of the template.
        Throws:
        java.lang.IllegalArgumentException - if any of the arguments is null.
        java.lang.RuntimeException - if an I/O error occurred during file generation.
      • generate

        public void generate()
                      throws java.io.IOException
        Generates the target file.
        Specified by:
        generate in interface FileGenerator
        Throws:
        java.io.IOException - It is raised if the methods fails to create the target file.