fr.umlv.tatoo.cc.common.generator
Class Generator

java.lang.Object
  extended by fr.umlv.tatoo.cc.common.generator.Generator
Direct Known Subclasses:
ASTGenerator, LexerGenerator, ParserGenerator, SwitchLexerGenerator, ToolsGenerator

public class Generator
extends Object

Generate file using a template system.

Author:
remi

Constructor Summary
Generator(File sourceDir, Class<?> clazz, Iterable<? extends File> classPath)
           
 
Method Summary
 void generate(Map<String,?> root, Map<AliasPrototype,? extends Alias> aliasMap, AliasPrototype prototype)
           
protected  void generate(Map<String,?> map, String templateName, Type type)
          Generates the source code of a type using a template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Generator

public Generator(File sourceDir,
                 Class<?> clazz,
                 Iterable<? extends File> classPath)
Method Detail

generate

public void generate(Map<String,?> root,
                     Map<AliasPrototype,? extends Alias> aliasMap,
                     AliasPrototype prototype)
              throws GeneratorException
Throws:
GeneratorException

generate

protected void generate(Map<String,?> map,
                        String templateName,
                        Type type)
                 throws GeneratorException
Generates the source code of a type using a template.

Parameters:
map - a map containg properties.
templateName - the name of the velocity template.
type - the generated type.
Throws:
GeneratorException