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

java.lang.Object
  extended by ch.sahits.codegen.java.generator.ast.AbstractReferenceImplCaller
      extended by ch.sahits.codegen.java.generator.ast.ASTBeanWithDelete
All Implemented Interfaces:
IBaseGenerator, IGenerator, IASTGenerator, IASTGeneratorInitializer, IReferenceImpleCaller

public final class ASTBeanWithDelete
extends AbstractReferenceImplCaller
implements IGenerator, IASTGeneratorInitializer

This class is a generator class that copies the delete method into the provided base class. This generator class needs a reference implementation, hence it implements the marker interface IReferenceImpleCaller via AbstractReferenceImplCaller.

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

Field Summary
 
Fields inherited from class ch.sahits.codegen.java.generator.ast.AbstractReferenceImplCaller
ast, unit
 
Constructor Summary
ASTBeanWithDelete()
          Default Constructor
 
Method Summary
 void cleanup()
          Clean up the generator
 java.lang.String generate()
          Generate the code
 IJetGatewayConfiguration getConfig()
          Retrieve the configuration object
 int getWorkload()
          Retrieve the workload for the generation
 void init()
          Initialize this instance
 void init(IJetGatewayConfiguration config)
          Null implementation Do nothing since the initialization is done with init()
 boolean isInitialized()
          Check whether all members are initialized
 IFile save(IProgressMonitor monitor, byte[] contents)
          Save to file
 void setBaseClass(java.lang.String _baseClass)
           
 void setGenerator(ASTGenerator _generator)
          Initialize the ASTGenerator
 void setModel(IGeneratedJavaDBClass _model)
           
 void setMonitor(IProgressMonitor monitor)
          Set the progress-Monitor
 
Methods inherited from class ch.sahits.codegen.java.generator.ast.AbstractReferenceImplCaller
addImports, addMethods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTBeanWithDelete

public ASTBeanWithDelete()
Default Constructor

Method Detail

generate

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

Specified by:
generate in interface IBaseGenerator
Specified by:
generate in interface IASTGenerator
Returns:
Source code as string

setModel

public void setModel(IGeneratedJavaDBClass _model)
Specified by:
setModel in interface IASTGenerator
Parameters:
_model - the model to set

setBaseClass

public void setBaseClass(java.lang.String _baseClass)
Specified by:
setBaseClass in interface IASTGenerator
Parameters:
_baseClass - the baseClass to set

isInitialized

public boolean isInitialized()
Check whether all members are initialized

Specified by:
isInitialized in interface IBaseGenerator
Returns:
true if the model and the baseClass are initialized

init

public void init(IJetGatewayConfiguration config)
Null implementation Do nothing since the initialization is done with init()

Specified by:
init in interface IBaseGenerator
Parameters:
config - Configuration

setGenerator

public void setGenerator(ASTGenerator _generator)
Description copied from interface: IASTGeneratorInitializer
Initialize the ASTGenerator

Specified by:
setGenerator in interface IASTGeneratorInitializer
Parameters:
_generator - the generator to set
See Also:
IASTGeneratorInitializer.setGenerator(ch.sahits.codegen.java.generator.ast.ASTGenerator)

cleanup

public void cleanup()
             throws CoreException
Clean up the generator

Specified by:
cleanup in interface IGenerator
Throws:
CoreException

getConfig

public IJetGatewayConfiguration getConfig()
Retrieve the configuration object

Specified by:
getConfig in interface IGenerator
Returns:
Configuration of this generator

getWorkload

public int getWorkload()
Retrieve the workload for the generation

Specified by:
getWorkload in interface IGenerator
Returns:
workload

init

public void init()
Initialize this instance

Specified by:
init in interface IGenerator

save

public IFile save(IProgressMonitor monitor,
                  byte[] contents)
           throws CoreException
Save to file

Specified by:
save in interface IGenerator
Parameters:
monitor - Progress-Monitor
contents - Byte array with the contents to be saved
Returns:
IFile instance of the saved contents
Throws:
CoreException

setMonitor

public void setMonitor(IProgressMonitor monitor)
Set the progress-Monitor

Specified by:
setMonitor in interface IGenerator
Parameters:
monitor - Progress Monitor