org.nuiton.guix.generator
Class JavaFileGenerator

java.lang.Object
  extended by org.nuiton.guix.generator.JavaFileGenerator

public abstract class JavaFileGenerator
extends java.lang.Object

Abstract class of all the generator which generate java files

Author:
kmorin

Nested Class Summary
static class JavaFileGenerator.Method
          Generated methods
 
Field Summary
protected  java.util.Map<java.lang.String,JavaFile> classes
          List of the classes to generate
protected  GuixModelObject gmo
          GuixModelObject which represents the class to generate
protected  java.util.List<java.lang.String> imports
          List of the class names to import
protected  JavaFile jf
          Java file generated
protected  org.apache.commons.logging.Log log
          log
 
Constructor Summary
JavaFileGenerator(GuixModelObject gmo, java.util.Map<java.lang.String,JavaFile> classes)
          Constructor
 
Method Summary
protected abstract  void addImports()
          Add imports to the generated file
abstract  JavaFile generate()
          Generates the JavaFile repesnting the class described by the GuixModelObject gmo
protected  java.lang.String getMethodName(JavaFileGenerator.Method m)
          Get the name of the generated method m
 void saveFile(java.io.File out)
          Fills and saves the generated file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
log


imports

protected java.util.List<java.lang.String> imports
List of the class names to import


classes

protected java.util.Map<java.lang.String,JavaFile> classes
List of the classes to generate


gmo

protected GuixModelObject gmo
GuixModelObject which represents the class to generate


jf

protected JavaFile jf
Java file generated

Constructor Detail

JavaFileGenerator

public JavaFileGenerator(GuixModelObject gmo,
                         java.util.Map<java.lang.String,JavaFile> classes)
Constructor

Parameters:
gmo - GuixModelObject which represents the class to generate
classes - List of the classes to generate
Method Detail

generate

public abstract JavaFile generate()
Generates the JavaFile repesnting the class described by the GuixModelObject gmo

Returns:
the generated JavaFile

addImports

protected abstract void addImports()
Add imports to the generated file


saveFile

public void saveFile(java.io.File out)
Fills and saves the generated file

Parameters:
out - the file to record

getMethodName

protected java.lang.String getMethodName(JavaFileGenerator.Method m)
Get the name of the generated method m

Parameters:
m - the generated method we would like to know the name
Returns:
the name of the method m


Copyright © 2009 CodeLutin. All Rights Reserved.