Class OutputFileGenerator


  • public class OutputFileGenerator
    extends java.lang.Object
    Generates boiler-plate files from templates. Only very basic template processing is supplied - if we need something more sophisticated I suggest we use a third-party library.
    Since:
    4.2
    Author:
    paulcager
    • Constructor Summary

      Constructors 
      Constructor Description
      OutputFileGenerator​(java.lang.String templateName, java.util.Map options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generate​(java.io.PrintWriter out)
      Generate the output file.
      static void generateFromTemplate​(java.lang.String template, java.util.Map<java.lang.String,​java.lang.Object> options, java.lang.String outputFileName)  
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

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

      • OutputFileGenerator

        public OutputFileGenerator​(java.lang.String templateName,
                                   java.util.Map options)
        Parameters:
        templateName - the name of the template. E.g. "/templates/Token.template".
        options - the processing options in force, such as "STATIC=yes"
    • Method Detail

      • generate

        public void generate​(java.io.PrintWriter out)
                      throws java.io.IOException
        Generate the output file.
        Parameters:
        out -
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • generateFromTemplate

        public static void generateFromTemplate​(java.lang.String template,
                                                java.util.Map<java.lang.String,​java.lang.Object> options,
                                                java.lang.String outputFileName)
                                         throws java.io.IOException
        Throws:
        java.io.IOException