<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Java Code Generation Features</title>
</head>
<body>
<h1>Java Code Generation Features</h1>
<h2>Supported databases</h2>
<p>Every database that is part of the datatools project can be used. All you have to do is
register the database. On how to do that please refere to the
<a href="http://wiki.eclipse.org/index.php/Getting_Started_with_DTP">wiki</a> of the project. If you
don't use DTP or run on eclipse prior to Ganymed the selection of available databases is limited to
MySQL, SQL Server and Oracle.
</p>
<h2>Input data</h2>
<p>Since the code generation is based on some kind of model this model must be generated from some kind
of input. One such kind is a database table. The input data can be gained through datatools connection,
direct connection to the database or the create script of the table.<p>
<p>Another obvious input format are XML files. Since an XML file can hold praticularly hold any data an
interpreter for this data must be defined. An XHTML file is a subclass of XML and well defined. Therefore
an XHTML form can be used as an input as well, though not all Elements are supported.</p>
<p>The input methods are very flexible and highly extensible. For further information see the Extension point
reference section.</p>
<h2>Code Generation</h2>
<p>For code generation two different technologies are used: Java Emitter Templates and Abstract Syntax Trees.
These two can be used on their own or in combination. With JET you can also define if a ready made JETemplate
should be used or the template should be generated.</p>
<p>Using AST you have the possibility to specify a reference implementation. Such a reference implementation
is used like an AST template where code from one class is copied to another with regard to variable replacement.
</p>
<h2><a name="overview">Overview</a></h2>
<p>There are many possibilities to extend the functionality therefore an overview is in order to show
what is supplied by Sahits:</p>
<ul>
<li>ch.sahits.codegen.java.generator: This extention point let's you provide your own generator classes:
ch.sahits.codegen.java.generator.jettemplate.InitializableDbBeanGenerator,
ch.sahits.codegen.java.generator.ast.PureASTOracleDAOGenerator,
ch.sahits.codegen.java.generator.ast.ASTBeanWithDelete,
ch.sahits.codegen.java.generator.ast.JETASTGenerator</li>
<li>ch.sahits.codegen.java.jettemplate: Adding additional JETemplates: dbbean, swtgui</li>
<li>ch.sahits.codegen.java.inputparser: Parser classes for a specific file extension:
ch.sahits.codegen.java.gui.input.XHTMLModelParser</li>
<li>ch.sahits.codegen.java.inputdbparser: A Parser for an *.sql file for a specific DB product.
If for one database product more than one implementation/extension exits only the first one found in
the registry is evaluated: MySQL, Oracle, SQLServer</li>
<li>ch.sahits.codegen.java.inputdbconnection: Model generator for table data retrieved through a
connection: MySQL, Oracle, SQLServer</li>
<li>ch.sahits.codegen.inputxmlparser: Specifiey classes that can parse an XML input file:
ch.sahits.codegen.xml.XMLParserWithoutDB, ch.sahits.codegen.java.input.XMLTableParser</li>
<li>ch.sahits.codegen.java.connectionpage: This extension point lets you add your own method
to access database definitions: Database connection, DTP connection</li>
<li>ch.sahits.codegen.generator: This extension point let you define the means of generating an arbitrary
code fragment. The generation can be done through a JETemplate or a generator class.</li>
</ul>
<p>Some extension points define a ranking value. If you define a plugin yourself with a higher ranking
value for the same purpose your extension will override the the default implementation</p>
</body>
</html>