ch.sahits.codegen.java.generator.ast
Class AbstractJETASTGenerator

java.lang.Object
  extended by ch.sahits.codegen.generator.AbstractGenerator
      extended by ch.sahits.codegen.generator.JETGateway
          extended by ch.sahits.codegen.java.generator.jettemplate.AbstractJETTemplateGenerator
              extended by ch.sahits.codegen.java.generator.ast.AbstractJETASTGenerator
All Implemented Interfaces:
IBaseGenerator, IGenerator
Direct Known Subclasses:
DAOGenerator, JETASTGenerator

public abstract class AbstractJETASTGenerator
extends AbstractJETTemplateGenerator

This abstract class provides you with the basic methods to generate a Class from a JET template and improve it with AST

Since:
0.9.0 TODO replace IGeneratedJavaDBClass with IGeneratedJavaDBClass2
Author:
Andi Hotz

Field Summary
protected  Document document
          Document on which the modifications are made
protected  IGeneratedJavaDBClass model
          Java database class model
protected  CompilationUnit unit
          The compilation unit that will be generated
 
Fields inherited from class ch.sahits.codegen.java.generator.jettemplate.AbstractJETTemplateGenerator
jetTemplateFile
 
Constructor Summary
AbstractJETASTGenerator()
          Default constructor.
 
Method Summary
protected  void addImports()
          This is a null implementation since this classes are not needed in the class hierarchy from here on down.
 void cleanup()
          Execute the cleanup defined in the super class.
protected abstract  JETGateway createJetGenerator()
          Create a feasable JET generator
 java.lang.String generate()
          Generate the code
protected abstract  void generateASTCode()
          This methods adds the AST parts to the code
protected  void generateTemplate()
          This is a null implementation since this classes are not needed in the class hierarchy from here on down.
abstract  void setBaseClass(java.lang.String baseClass)
           
 
Methods inherited from class ch.sahits.codegen.java.generator.jettemplate.AbstractJETTemplateGenerator
addImport, addJetPluginID2Builder, append, appendLn, generate, init, writeDirective
 
Methods inherited from class ch.sahits.codegen.generator.JETGateway
getJETEmitter, getWorkload, init, isInitialized, setMonitor
 
Methods inherited from class ch.sahits.codegen.generator.AbstractGenerator
createIfNull, findOrCreateContainer, getConfig, save, setConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.sahits.codegen.generator.IGenerator
getConfig, save
 

Field Detail

document

protected Document document
Document on which the modifications are made


model

protected IGeneratedJavaDBClass model
Java database class model


unit

protected CompilationUnit unit
The compilation unit that will be generated

Constructor Detail

AbstractJETASTGenerator

public AbstractJETASTGenerator()
Default constructor. The use of this constructor

Method Detail

cleanup

public final void cleanup()
                   throws CoreException
Description copied from class: AbstractJETTemplateGenerator
Execute the cleanup defined in the super class. Then delete the temporary file.

Specified by:
cleanup in interface IGenerator
Overrides:
cleanup in class AbstractJETTemplateGenerator
Throws:
CoreException
See Also:
AbstractJETTemplateGenerator.cleanup()

createJetGenerator

protected abstract JETGateway createJetGenerator()
Create a feasable JET generator

Returns:
JETGateway

generate

public final java.lang.String generate()
Generate the code

Specified by:
generate in interface IBaseGenerator
Overrides:
generate in class JETGateway
Returns:
String representation of the generated class

generateASTCode

protected abstract void generateASTCode()
This methods adds the AST parts to the code


setBaseClass

public abstract void setBaseClass(java.lang.String baseClass)
Parameters:
baseClass - the baseClass to set

addImports

protected final void addImports()
This is a null implementation since this classes are not needed in the class hierarchy from here on down.

Specified by:
addImports in class AbstractJETTemplateGenerator

generateTemplate

protected final void generateTemplate()
This is a null implementation since this classes are not needed in the class hierarchy from here on down.

Specified by:
generateTemplate in class AbstractJETTemplateGenerator