|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xcodegen.generator.AbstractCodeGenerator | +--xcodegen.generator.sql.AbstractSQLCodeGenerator
Base class of SQL code generators
Field Summary |
Fields inherited from interface xcodegen.generator.CodeGenerator |
CONFIG_CLASS_OUTPUT_DIR, CONFIG_CLASS_PREFIX, CONFIG_CLASS_SUFFIX, CONFIG_DATABASE, CONFIG_DATABASE_OUTPUT_DIR, CONFIG_DATABASE_OUTPUT_FILE, CONFIG_DATABASE_STRING_SIZE, CONFIG_LANGUAGE, CONFIG_PACKAGE_SUFFIX |
Constructor Summary | |
AbstractSQLCodeGenerator(java.lang.String name)
Create a new SQLCodeGenerator |
Method Summary | |
protected void |
generate(XClass clazz,
org.apache.velocity.VelocityContext context,
org.apache.velocity.Template template)
Generate the code of a class |
void |
generate(XPackage[] packages)
Generate to code of a set of packages |
protected void |
generate(XPackage pkg,
org.apache.velocity.VelocityContext context,
org.apache.velocity.Template template)
Generate the code of a package |
java.util.Collection |
getClasses()
Return all the classes to generate |
java.util.Collection |
getClassesReverse()
Return all the classes to generate in reverse order |
java.lang.String |
getType(XField field)
Return the SQL type of a given field |
java.lang.String |
getVelocityTemplatePath()
Return the path the the template |
void |
init(java.util.Properties config)
Initialize the code generator |
Methods inherited from class xcodegen.generator.AbstractCodeGenerator |
getConfigProperty, getLogger, getName, getVelocityContext, getVelocityTemplate, loadResourceAsProperties |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractSQLCodeGenerator(java.lang.String name)
Method Detail |
public java.lang.String getType(XField field)
field
- field for which the type is requester
public java.util.Collection getClasses()
public java.util.Collection getClassesReverse()
public void init(java.util.Properties config) throws XCodeGenException
CodeGenerator
init
in interface CodeGenerator
init
in class AbstractCodeGenerator
config
- Configuration of the code generator
XCodeGenException
- if any error occurs during the initializationpublic void generate(XPackage[] packages) throws XCodeGenException, java.io.IOException
CodeGenerator
generate
in interface CodeGenerator
generate
in class AbstractCodeGenerator
java.io.IOException
- if any IO error
XCodeGenException
public java.lang.String getVelocityTemplatePath()
AbstractCodeGenerator
getVelocityTemplatePath
in class AbstractCodeGenerator
protected void generate(XPackage pkg, org.apache.velocity.VelocityContext context, org.apache.velocity.Template template) throws XCodeGenException, java.io.IOException
AbstractCodeGenerator
generate
in class AbstractCodeGenerator
pkg
- Package to generatecontext
- Velocity contexttemplate
- Template used for generating the code
XCodeGenException
- If any error occurs during the code generation
java.io.IOException
protected void generate(XClass clazz, org.apache.velocity.VelocityContext context, org.apache.velocity.Template template) throws XCodeGenException, java.io.IOException
AbstractCodeGenerator
generate
in class AbstractCodeGenerator
clazz
- Class to generatecontext
- Velocity contexttemplate
- Template used for generating the code
XCodeGenException
- If any error occurs during the code generation
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |