ch.sahits.codegen.java.wizards
Class BasicHeadlessJavaCodeGenerator

java.lang.Object
  extended by ch.sahits.codegen.wizards.BasicGeneralCodeGenerator
      extended by ch.sahits.codegen.java.wizards.BasicHeadlessJavaCodeGenerator
All Implemented Interfaces:
IProcessQueuedAction

public class BasicHeadlessJavaCodeGenerator
extends BasicGeneralCodeGenerator

This is the base class for java code generators. This class must be extended to add specific functionality.
This is the implementation for the headless build

Since:
2.1.0
Author:
Andi Hotz, Sahits GmbH

Field Summary
protected  ILogger logger
           
 
Fields inherited from class ch.sahits.codegen.wizards.BasicGeneralCodeGenerator
delegate
 
Constructor Summary
BasicHeadlessJavaCodeGenerator(ICodeGeneratorDelegate delegatedGenerator)
          Constructor initializing the delegated code generator
 
Method Summary
protected  void addException(java.lang.RuntimeException e)
          Add an exception to the logger
protected  void doFinish(IFile file, IProgressMonitor monitor)
          Open a file to be displayed, if a view to open in is avalable
protected  void doFinish(IProgressMonitor monitor, int modelWorkload, IBasicDBDefinitionPage dbDefinitionPage)
          Produce a java class source file
protected  void openEditor(IFile file)
          Open the file in an editor if available
 
Methods inherited from class ch.sahits.codegen.wizards.BasicGeneralCodeGenerator
processQueuedElements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected ILogger logger
Constructor Detail

BasicHeadlessJavaCodeGenerator

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

Parameters:
delegatedGenerator -
Method Detail

doFinish

protected void doFinish(IProgressMonitor monitor,
                        int modelWorkload,
                        IBasicDBDefinitionPage dbDefinitionPage)
                 throws java.io.FileNotFoundException,
                        java.io.IOException,
                        java.lang.ClassNotFoundException,
                        CoreException
Produce a java class source file

Specified by:
doFinish in class BasicGeneralCodeGenerator
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

openEditor

protected void openEditor(IFile file)
Open the file in an editor if available

Parameters:
file -

addException

protected void addException(java.lang.RuntimeException e)
Add an exception to the logger

Parameters:
e - exeption to be added

doFinish

protected void doFinish(IFile file,
                        IProgressMonitor monitor)
                 throws CoreException
Open a file to be displayed, if a view to open in is avalable

Parameters:
file -
monitor -
Throws:
CoreException