ch.sahits.codegen.php
Class PHPCodeGenerator

java.lang.Object
  extended by ch.sahits.codegen.model.BasicModelGenerator
      extended by ch.sahits.codegen.php.PHPCodeGenerator
All Implemented Interfaces:
IDBAccess, IGeneralGenerator, IGeneralStringGenerator

public class PHPCodeGenerator
extends BasicModelGenerator
implements IGeneralStringGenerator, IDBAccess

Generator class for PHP classes based on a database structure and an PHP class model (initialized through XML)

Since:
2.1.0
Author:
Andi Hotz, Sahits GmbH

Constructor Summary
PHPCodeGenerator()
           
 
Method Summary
 IGeneratedObject createModel(IProgressMonitor monitor, IOutputFileModel model)
          Create an arbitrary model for the generator class.
 java.lang.String generate()
          Generat a PHP class based on a IPHPDBModel that implements the toString method.
 void init(IOutputFileModel outputModel, IGeneratedObject model)
          Initialize the model this generators model The model must be an instance of IPHPDBModel.
 boolean isGeneratedOutputFile()
          Check whether the output is a file
 
Methods inherited from class ch.sahits.codegen.model.BasicModelGenerator
createModelWithDBInputFile, createModelWithoutDB, initModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PHPCodeGenerator

public PHPCodeGenerator()
Method Detail

createModel

public IGeneratedObject createModel(IProgressMonitor monitor,
                                    IOutputFileModel model)
Create an arbitrary model for the generator class. Create an IPHPDBModel from the object model.

Specified by:
createModel in interface IGeneralGenerator
Parameters:
monitor - to monitor the progress
model - Model of the data of the wizard
Returns:
Object model that is passed as the second parameter to init(IOutputFileModel, IGeneratedObject)

init

public void init(IOutputFileModel outputModel,
                 IGeneratedObject model)
Initialize the model this generators model The model must be an instance of IPHPDBModel. If the model is not of this type a ClassCastException is thrown

Specified by:
init in interface IGeneralGenerator
Parameters:
outputModel - IOutputFileModel that defines the setup of the generation
model - IPHPDBModel

isGeneratedOutputFile

public boolean isGeneratedOutputFile()
Check whether the output is a file

Specified by:
isGeneratedOutputFile in interface IGeneralGenerator
Returns:
false

generate

public java.lang.String generate()
Generat a PHP class based on a IPHPDBModel that implements the toString method.

Specified by:
generate in interface IGeneralStringGenerator
Returns:
String representation of a php class