ch.sahits.codegen.wizards
Class BasicGeneralCodeGenerator

java.lang.Object
  extended by ch.sahits.codegen.wizards.BasicGeneralCodeGenerator
All Implemented Interfaces:
IProcessQueuedAction
Direct Known Subclasses:
ArtefactCodeGenerator, BasicHeadlessJavaCodeGenerator

public abstract class BasicGeneralCodeGenerator
extends java.lang.Object
implements IProcessQueuedAction

This basic generator class defines the basis for code generation. Java sources as well as other artefactes can be pruduced with subclasses of this abstract class

Since:
1.2.0
Author:
Andi Hotz

Field Summary
protected  ICodeGeneratorDelegate delegate
          Class to which the concrete tasks are delegated
 
Constructor Summary
BasicGeneralCodeGenerator(ICodeGeneratorDelegate delegatedGenerator)
          Constructor initializing the delegated code generator
 
Method Summary
protected abstract  void doFinish(IProgressMonitor monitor, int modelWorkload, IBasicDBDefinitionPage dbDefinitionPage)
          Produce an artifact file
 void processQueuedElements()
          Retrieve all elements in the Process queue that are registered for this element and process them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected ICodeGeneratorDelegate delegate
Class to which the concrete tasks are delegated

Constructor Detail

BasicGeneralCodeGenerator

public BasicGeneralCodeGenerator(ICodeGeneratorDelegate delegatedGenerator)
Constructor initializing the delegated code generator

Parameters:
delegatedGenerator -
Method Detail

doFinish

protected abstract void doFinish(IProgressMonitor monitor,
                                 int modelWorkload,
                                 IBasicDBDefinitionPage dbDefinitionPage)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException,
                                 java.lang.ClassNotFoundException,
                                 CoreException
Produce an artifact file

Parameters:
monitor - IProgressMonitor to track the progress
modelWorkload - Workload for the generation
dbDefinitionPage - current DB definition page
Throws:
java.io.FileNotFoundException - File could not be found
java.io.IOException - File could not be read
java.lang.ClassNotFoundException - Class not found on the class path
CoreException - some other exception

processQueuedElements

public final void processQueuedElements()
Retrieve all elements in the Process queue that are registered for this element and process them. Each element that is processed is then removed from the queue

Specified by:
processQueuedElements in interface IProcessQueuedAction