|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javaWebGen.data.DAO
org.javaWebGen.util.CodeGenerator
public abstract class CodeGenerator
Base Code generator class that handles common functions among the code generators
Field Summary | |
---|---|
static java.lang.String |
TS
TAB spacer (IE 4 spaces |
Fields inherited from class org.javaWebGen.data.DAO |
---|
TOO_MANY_ROWS, TOO_MANY_ROWS_WARNING |
Constructor Summary | |
---|---|
CodeGenerator()
|
Method Summary | |
---|---|
protected abstract void |
execute()
|
protected java.lang.String |
getClassText(java.lang.String templateText,
java.lang.String[] parms)
Gets the code that has tags replaced in it |
protected java.lang.String[] |
getColNames()
|
protected int[] |
getColTypes()
|
protected java.lang.String |
getFileName()
|
protected java.lang.String |
getFilePath()
return file path ie where to write the output java source |
protected java.util.ArrayList<java.lang.String> |
getPrimaryKeys()
|
protected int[] |
getPrimaryKeyTypes()
|
protected java.lang.String |
getPrimayParmCast(java.lang.String key,
int type)
generate a string to convert from a string to correct Object type |
protected java.lang.String |
getTableName()
get current table name |
protected java.lang.String |
getTemplate(java.lang.String defaultTemplate)
Get the template from a file if it exists if not return the default template |
protected java.lang.String |
getVars(java.util.List<java.lang.String> keys,
int[] types)
Return the type of variable. |
abstract void |
init()
run init code ie stuff to setup templates |
protected void |
mapData()
map data types from current table |
protected void |
processFile(java.lang.String fileName)
process table list |
protected boolean |
setCmdParms(java.lang.String[] args)
get the parms that where passed in on the command line and set the correct vars |
protected void |
setTableName(java.lang.String table)
sets the current table name |
abstract void |
useage()
print instruction on how to object from the command line to sysout |
Methods inherited from class org.javaWebGen.data.DAO |
---|
close, getColumnClass, getConnection, getDataManager, getNextValue, getNextValue, getResultSet, query, query, query, query, runQuery, runQuery, runQuery, runQuery, setColumn, update, update, update, update, updateDataBean, updateDataBean |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TS
Constructor Detail |
---|
public CodeGenerator()
Method Detail |
---|
protected void mapData() throws java.sql.SQLException
java.sql.SQLException
protected void processFile(java.lang.String fileName) throws java.io.IOException, UtilException
fileName
- input file name id table list
java.io.IOException
- error reading the file
UtilException
protected boolean setCmdParms(java.lang.String[] args) throws java.lang.Exception
args
- cmd line parms
java.lang.Exception
protected java.lang.String getTemplate(java.lang.String defaultTemplate)
defaultTemplate
- text
protected java.lang.String getClassText(java.lang.String templateText, java.lang.String[] parms)
templateText
- parms
-
protected java.lang.String getVars(java.util.List<java.lang.String> keys, int[] types)
keys
- column namestypes
- sql type
protected java.lang.String getPrimayParmCast(java.lang.String key, int type)
key
- primary keytype
- SQL type
protected java.lang.String getFileName()
protected java.lang.String getFilePath()
protected java.lang.String getTableName()
protected void setTableName(java.lang.String table)
table
- protected java.lang.String[] getColNames()
protected int[] getColTypes()
protected java.util.ArrayList<java.lang.String> getPrimaryKeys()
protected int[] getPrimaryKeyTypes()
protected abstract void execute() throws UtilException
UtilException
public abstract void useage()
public abstract void init() throws UtilException
UtilException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |