public class BaseModelGenerator extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
baseModelOutputDir |
protected String |
baseModelPackageName |
protected Engine |
engine |
protected boolean |
generateChainSetter |
protected Map<String,String> |
getterTypeMap
针对 Model 中七种可以自动转换类型的 getter 方法,调用其具有确定类型返回值的 getter 方法
享用自动类型转换的便利性,例如 getInt(String)、getStr(String)
其它方法使用泛型返回值方法: get(String)
注意:jfinal 3.2 及以上版本 Model 中的六种 getter 方法才具有类型转换功能
|
protected JavaKeyword |
javaKeyword |
protected String |
template |
Constructor and Description |
---|
BaseModelGenerator(String baseModelPackageName,
String baseModelOutputDir) |
Modifier and Type | Method and Description |
---|---|
protected void |
genBaseModelContent(TableMeta tableMeta) |
void |
generate(List<TableMeta> tableMetas) |
protected void |
initEngine() |
void |
setGenerateChainSetter(boolean generateChainSetter) |
void |
setTemplate(String template)
使用自定义模板生成 base model
|
protected void |
writeToFile(List<TableMeta> tableMetas) |
protected void |
writeToFile(TableMeta tableMeta)
base model 覆盖写入
|
protected Engine engine
protected String template
protected String baseModelPackageName
protected String baseModelOutputDir
protected boolean generateChainSetter
protected JavaKeyword javaKeyword
protected void initEngine()
public void setTemplate(String template)
public void setGenerateChainSetter(boolean generateChainSetter)
protected void genBaseModelContent(TableMeta tableMeta)
protected void writeToFile(TableMeta tableMeta) throws IOException
IOException
Copyright © 2018. All rights reserved.