ch.sahits.codegen.model
Class BasicModelGenerator

java.lang.Object
  extended by ch.sahits.codegen.model.BasicModelGenerator
Direct Known Subclasses:
BasicAxis2ModelGenerator, HibernateConfigurationCreator, PHPCodeGenerator

public abstract class BasicModelGenerator
extends java.lang.Object

This class provides functionality to generate a input data model based on the IOutputFileModel.

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

Constructor Summary
BasicModelGenerator()
           
 
Method Summary
static IGeneratedObject createModelWithDBInputFile(java.lang.String typeName, java.lang.String dbProduct, java.lang.String inputFilePath, IJavaProject project, IProgressMonitor monitor)
          Generates the model based on the class name and the inputFilePath Data in the wizard provided but not contained in the inputfilePath must be added to the model by the caller
static IGeneratedObject createModelWithoutDB(java.lang.String typeName, java.lang.String inputFilePath, IProgressMonitor monitor)
          Generates a model for the class that is not based on a database table
 IGeneratedObject initModel(IProgressMonitor monitor, IOutputFileModel model, IBasicDBDefinitionPage dbDefintionPage)
          Create and initialize a model for the class to be generated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicModelGenerator

public BasicModelGenerator()
Method Detail

initModel

public final IGeneratedObject initModel(IProgressMonitor monitor,
                                        IOutputFileModel model,
                                        IBasicDBDefinitionPage dbDefintionPage)
                                 throws java.io.FileNotFoundException,
                                        java.io.IOException,
                                        java.lang.ClassNotFoundException
Create and initialize a model for the class to be generated

Parameters:
monitor - Progress monitor
model - input model containing the pages data
dbDefintionPage - current DB definition page
Returns:
class model
Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

createModelWithDBInputFile

public static IGeneratedObject createModelWithDBInputFile(java.lang.String typeName,
                                                          java.lang.String dbProduct,
                                                          java.lang.String inputFilePath,
                                                          IJavaProject project,
                                                          IProgressMonitor monitor)
                                                   throws java.io.FileNotFoundException,
                                                          java.io.IOException
Generates the model based on the class name and the inputFilePath Data in the wizard provided but not contained in the inputfilePath must be added to the model by the caller

Parameters:
typeName - name of the class
dbProduct - name of the database product
inputFilePath - path to the input file the model is based upon
project - java project to generate the class in
monitor - Progress monitor
Returns:
model of a subtype of IGeneratedJavaDBClass
Throws:
java.io.IOException - File could not be read
java.io.FileNotFoundException - File path incorrect

createModelWithoutDB

public static IGeneratedObject createModelWithoutDB(java.lang.String typeName,
                                                    java.lang.String inputFilePath,
                                                    IProgressMonitor monitor)
Generates a model for the class that is not based on a database table

Parameters:
typeName - name of the class
inputFilePath - path to the input file the model is based upon
monitor - Progress monitor
Returns:
generated model