com.evelopers.unimod.transform.source
Class ModelToSource

java.lang.Object
  extended bycom.evelopers.unimod.transform.source.ModelToSource

public class ModelToSource
extends java.lang.Object

Generate source file from given templates. Requires velocity templates.


Method Summary
static ModelToSource create(Logger log)
           
 void generate(java.io.File templateFile, Model model, java.io.File outputFile, java.util.Map additionalParameters)
          Generates source file based on given template file
 void generate(java.io.File jarFile, java.lang.String templateName, Model model, java.io.File outputFile, java.util.Map additionalParameters)
          Generates source file based on given template from given jar file
 void generate(java.lang.String templateResourceName, Model model, java.io.File outputFile, java.util.Map additionalParameters)
          Generates source file based on given template from class path
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
 

Method Detail

create

public static ModelToSource create(Logger log)

generate

public void generate(java.io.File jarFile,
                     java.lang.String templateName,
                     Model model,
                     java.io.File outputFile,
                     java.util.Map additionalParameters)
              throws TransformException
Generates source file based on given template from given jar file

Parameters:
jarFile - jar fle with templates
templateName - templte name inside jar file
model - model to generate source from
outputFile - output file
additionalParameters - additional templates parameters
Throws:
TransformException

generate

public void generate(java.lang.String templateResourceName,
                     Model model,
                     java.io.File outputFile,
                     java.util.Map additionalParameters)
              throws TransformException
Generates source file based on given template from class path

Parameters:
templateResourceName - template file in classpath
model -
outputFile -
additionalParameters -
Throws:
TransformException

generate

public void generate(java.io.File templateFile,
                     Model model,
                     java.io.File outputFile,
                     java.util.Map additionalParameters)
              throws TransformException
Generates source file based on given template file

Parameters:
templateFile - template file
model -
outputFile -
additionalParameters -
Throws:
TransformException

main

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