|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.phoenix.cmpgen2.CmpGenerator
public class CmpGenerator
This is a velocity based version of the CMP generator.
| Constructor Summary | |
|---|---|
CmpGenerator(String outputDir,
String pkgPrefix,
String dataSource,
String templateDir,
boolean overwrite)
Construct CMP bean generator. |
|
| Method Summary | |
|---|---|
Set |
buildBeanImportList(CreateTableStatement statement)
|
Set |
buildHelperImportList(CreateTableStatement statement)
|
String |
capitalize(String s)
This method capitalizes the first character of the given string and, assuming that the argument is usually a java type, also takes care of arrays by replacing "[]" with "Array". |
boolean |
checkIfHelperRequired(CreateTableStatement statement)
Checks if a helper class is required for this bean a helper class is required as soon as a custom java type is used with a load method and a store method. |
void |
generateCmpBeans(String inputFile)
Entry method for CMP bean generator. |
String |
getQualifiedJavaType(ColumnSpec column)
|
String |
getUnqualifiedJavaType(ColumnSpec column)
|
String |
getVersion()
|
boolean |
isPrimitiveType(String type)
|
static void |
main(String[] args)
Main method. |
String |
sqlNameToJavaName(String sqlName)
|
String |
toString()
|
String |
unqualifyType(String type)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CmpGenerator(String outputDir,
String pkgPrefix,
String dataSource,
String templateDir,
boolean overwrite)
outputDir - the output directorypkgPrefix - the package prefixdataSource - the jndi name of the data source| Method Detail |
|---|
public static void main(String[] args)
throws Exception
args - command line args
Exception
public final void generateCmpBeans(String inputFile)
throws Exception
inputFile - the input file
Exceptionpublic String sqlNameToJavaName(String sqlName)
public String capitalize(String s)
s - input to be modified.
public String getUnqualifiedJavaType(ColumnSpec column)
throws CmpGeneratorException
CmpGeneratorException
public String getQualifiedJavaType(ColumnSpec column)
throws CmpGeneratorException
CmpGeneratorExceptionpublic String unqualifyType(String type)
public boolean checkIfHelperRequired(CreateTableStatement statement)
statement - the parsed SQL create statement
public String getVersion()
public Set buildBeanImportList(CreateTableStatement statement)
throws CmpGeneratorException
CmpGeneratorException
public Set buildHelperImportList(CreateTableStatement statement)
throws CmpGeneratorException
CmpGeneratorExceptionpublic String toString()
toString in class Objectpublic boolean isPrimitiveType(String type)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||