ijgen.generator.engine
Class Generator

java.lang.Object
  extended by ijgen.generator.engine.Generator

public class Generator
extends java.lang.Object

Class responsible for batch execution of set of template generators.

Author:
Detelin Zlatev

Constructor Summary
Generator(java.lang.String modelsDirectory)
          Creates a generator for the templates contained in the directory that is specified as an argument.
 
Method Summary
 void addTemplateGenerator(TemplateGenerator templateGenerator)
          Adds a template generator instance that has to be processed.
 ModelDefinitionLoaderType getMode()
          Gets the type of model definitions.
protected  java.lang.String getModelsDirectory()
          Gets full path of the directory where class definitions stored.
 java.lang.String getTemplatesDirectory()
          Gets the root directory where where the template files for all generators are stored.
protected  void loadTemplateFiles()
          Loads all the template files recursively from the templatesDirectory folder
 void setMode(ModelDefinitionLoaderType mode)
          Sets the type of model definitions.
protected  void setModelsDirectory(java.lang.String modelsDirectory)
          Sets the directory where class definitions are stored.
 void setTemplatesDirectory(java.lang.String templatesDirectory)
          Sets the root directory where all the template files are stored.
 void start()
          Walks through all the defined generators in templateGenerators property and calls their implementations of generate method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Generator

public Generator(java.lang.String modelsDirectory)
Creates a generator for the templates contained in the directory that is specified as an argument.

Parameters:
modelsDirectory - templates directory
Method Detail

addTemplateGenerator

public void addTemplateGenerator(TemplateGenerator templateGenerator)
Adds a template generator instance that has to be processed.

Parameters:
templateGenerator - template generator instance that has to be processed

getModelsDirectory

protected java.lang.String getModelsDirectory()
Gets full path of the directory where class definitions stored.

Returns:
class definitions directory

setModelsDirectory

protected void setModelsDirectory(java.lang.String modelsDirectory)
Sets the directory where class definitions are stored.

Parameters:
modelsDirectory - class definitions directory

getTemplatesDirectory

public java.lang.String getTemplatesDirectory()
Gets the root directory where where the template files for all generators are stored.

Returns:
templates directory

setTemplatesDirectory

public void setTemplatesDirectory(java.lang.String templatesDirectory)
Sets the root directory where all the template files are stored.

Parameters:
templatesDirectory - templates directory

getMode

public ModelDefinitionLoaderType getMode()
Gets the type of model definitions.

Returns:
model definitions type

setMode

public void setMode(ModelDefinitionLoaderType mode)
Sets the type of model definitions.

Parameters:
mode - type

loadTemplateFiles

protected final void loadTemplateFiles()
Loads all the template files recursively from the templatesDirectory folder


start

public void start()
Walks through all the defined generators in templateGenerators property and calls their implementations of generate method.



Copyright © 2010 Detelin Zlatev. All Rights Reserved.