|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.sql2java.CodeWriter
public class CodeWriter
Field Summary | |
---|---|
protected static java.lang.String |
basePackage
|
static java.lang.String |
classPrefix
|
protected VelocityContext |
current_vc
|
protected static java.lang.String |
dateClassName
|
protected static Database |
db
|
protected static java.lang.String |
destDir
|
protected static java.util.Hashtable |
excludeHash
|
protected static java.util.Hashtable |
includeHash
|
static java.lang.String |
MGR_CLASS
|
protected static java.lang.String |
optimisticLockColumn
|
protected static java.lang.String |
optimisticLockType
|
protected static java.util.Properties |
props
|
Table |
table
|
protected static java.lang.String |
timeClassName
|
protected static java.lang.String |
timestampClassName
|
protected VelocityContext |
vc
|
Constructor Summary | |
---|---|
CodeWriter(Database db,
java.util.Properties props)
The Default Constructor |
Method Summary | |
---|---|
static boolean |
authorizeFile(java.lang.String folder,
java.lang.String schemaOrTable)
is this file to be processed or not ? |
static boolean |
authorizeProcess(java.lang.String autorizePattern,
java.lang.String includeProperty,
java.lang.String excludeProperty)
check the value for include & exclude lists defined in the config file |
void |
checkDatabase()
|
boolean |
checkTable(Table newTable)
|
static boolean |
folderContainsPattern(java.lang.String folder,
java.lang.String[] patterns)
|
java.lang.String |
getClassPrefix()
|
Database |
getDb()
Public accessor for db |
static java.lang.String[] |
getExplodedString(java.lang.String value)
|
java.lang.String |
getLoadingPath()
get loading path |
static java.lang.String |
getProperty(java.lang.String key)
Convenience property chop method |
static java.lang.String |
getProperty(java.lang.String key,
java.lang.String default_val)
Convenience property chop method |
static java.lang.String[] |
getPropertyExploded(java.lang.String key)
Return as a String array the key's value. |
static java.lang.String[] |
getPropertyExploded(java.lang.String mkey,
java.lang.String defaultValue)
|
java.util.List |
getRelationTables()
Returns from db.getTables() those having isRelationTable() evaluating to true. |
java.lang.String[] |
getSchemaTemplates(java.lang.String property)
|
Table |
getTable()
public accessor for table |
Table |
getTable(java.lang.String tableName)
Public db.getTable() |
java.util.List |
getTables()
Public db.getTables() |
java.lang.String[] |
getTableTemplates(java.lang.String property)
|
java.lang.String[] |
getTemplates(java.lang.String property,
boolean perShema)
|
boolean |
listContainsString(java.util.List list,
java.lang.String string)
Check if a list contains an item that is equal() to a string |
void |
log(java.lang.String logStr)
System.out.println() wrapper |
void |
process()
The entry point for generating code. |
java.util.Vector |
recurseTemplate(java.util.Vector files,
java.lang.String folder,
boolean perSchema)
recurse in the template folders |
void |
setCurrentFilename(java.lang.String relpath_or_package,
java.lang.String fn)
|
void |
setCurrentJavaFilename(java.lang.String relpath_or_package,
java.lang.String fn)
|
void |
setDestinationFolder(java.lang.String destDir)
|
java.lang.String |
tableName()
Return table.getName() |
void |
writeComponent(java.lang.String templateName)
This method creates a file and generates the class; it is based on the original SQL2Java methods The filename for the class is based on the value of the Velocity variable passed in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.Properties props
public static java.lang.String MGR_CLASS
protected static java.lang.String dateClassName
protected static java.lang.String timeClassName
protected static java.lang.String timestampClassName
protected static Database db
protected static java.util.Hashtable includeHash
protected static java.util.Hashtable excludeHash
protected static java.lang.String basePackage
protected static java.lang.String destDir
protected static java.lang.String optimisticLockType
protected static java.lang.String optimisticLockColumn
public static java.lang.String classPrefix
protected VelocityContext vc
public Table table
protected VelocityContext current_vc
Constructor Detail |
---|
public CodeWriter(Database db, java.util.Properties props)
props
- Properties for configuring this instanceMethod Detail |
---|
public void setDestinationFolder(java.lang.String destDir) throws java.lang.Exception
java.lang.Exception
public boolean checkTable(Table newTable) throws java.lang.Exception
java.lang.Exception
public void checkDatabase() throws java.lang.Exception
java.lang.Exception
public void process() throws java.lang.Exception
java.lang.Exception
public void writeComponent(java.lang.String templateName) throws java.lang.Exception
templateName
- The template to parse and generate fromvariableFileName
- A velocity variable on which to base the filename
java.lang.Exception
- (IOExceptions?)public void setCurrentFilename(java.lang.String relpath_or_package, java.lang.String fn) throws java.lang.Exception
java.lang.Exception
public void setCurrentJavaFilename(java.lang.String relpath_or_package, java.lang.String fn) throws java.lang.Exception
java.lang.Exception
public void log(java.lang.String logStr)
public java.lang.String getClassPrefix()
public Database getDb()
public java.util.List getTables()
public Table getTable(java.lang.String tableName)
public java.util.List getRelationTables()
public java.lang.String tableName()
public Table getTable()
public boolean listContainsString(java.util.List list, java.lang.String string)
public static java.lang.String getProperty(java.lang.String key)
key
- the property to get from this.props
public static java.lang.String getProperty(java.lang.String key, java.lang.String default_val)
key
- the property to get from this.propsdefault_val
- the default value to return in case not found
public static java.lang.String[] getPropertyExploded(java.lang.String key)
public static java.lang.String[] getPropertyExploded(java.lang.String mkey, java.lang.String defaultValue)
public static java.lang.String[] getExplodedString(java.lang.String value)
public java.lang.String getLoadingPath()
public java.lang.String[] getSchemaTemplates(java.lang.String property)
public java.lang.String[] getTableTemplates(java.lang.String property)
public java.lang.String[] getTemplates(java.lang.String property, boolean perShema)
public java.util.Vector recurseTemplate(java.util.Vector files, java.lang.String folder, boolean perSchema)
public static boolean authorizeProcess(java.lang.String autorizePattern, java.lang.String includeProperty, java.lang.String excludeProperty)
public static boolean folderContainsPattern(java.lang.String folder, java.lang.String[] patterns)
public static boolean authorizeFile(java.lang.String folder, java.lang.String schemaOrTable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |