类 AbstractTemplateEngine
java.lang.Object
com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine
模板引擎抽象类
- 从以下版本开始:
- 2018-01-10
- 作者:
- hubin
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明@NotNull AbstractTemplateEngine批量输出 java xml 文件@NotNull ConfigBuildergetObjectMap(@NotNull ConfigBuilder config, @NotNull TableInfo tableInfo) 渲染对象 MAP 信息protected FilegetOutputFile(String filePath, OutputFile outputFile) protected @Nullable StringgetPathInfo(@NotNull OutputFile outputFile) 获取路径信息getTemplateFilePath(@NotNull Function<TemplateConfig, String> function) 获取模板路径abstract @NotNull AbstractTemplateEngineinit(@NotNull ConfigBuilder configBuilder) 模板引擎初始化protected boolean检查文件是否创建文件voidopen()打开输出目录protected voidoutputController(@NotNull TableInfo tableInfo, @NotNull Map<String, Object> objectMap) 输出controller文件protected voidoutputCustomFile(@NotNull List<CustomFile> customFiles, @NotNull TableInfo tableInfo, @NotNull Map<String, Object> objectMap) 输出自定义模板文件protected voidoutputEntity(@NotNull TableInfo tableInfo, @NotNull Map<String, Object> objectMap) 输出实体文件protected voidoutputFile(@NotNull File file, @NotNull Map<String, Object> objectMap, @NotNull String templatePath, boolean fileOverride) 输出文件protected voidoutputMapper(@NotNull TableInfo tableInfo, @NotNull Map<String, Object> objectMap) 输出Mapper文件(含xml)protected voidoutputService(@NotNull TableInfo tableInfo, @NotNull Map<String, Object> objectMap) 输出service文件@NotNull AbstractTemplateEnginesetConfigBuilder(@NotNull ConfigBuilder configBuilder) protected String文件后缀abstract @NotNull StringtemplateFilePath(@NotNull String filePath) 模板真实文件路径abstract voidwriter(@NotNull Map<String, Object> objectMap, @NotNull String templatePath, @NotNull File outputFile) 将模板转化成为文件
-
字段详细资料
-
LOGGER
protected final org.slf4j.Logger LOGGER
-
-
构造器详细资料
-
AbstractTemplateEngine
public AbstractTemplateEngine()
-
-
方法详细资料
-
init
@NotNull public abstract @NotNull AbstractTemplateEngine init(@NotNull @NotNull ConfigBuilder configBuilder) 模板引擎初始化 -
outputCustomFile
protected void outputCustomFile(@NotNull @NotNull List<CustomFile> customFiles, @NotNull @NotNull TableInfo tableInfo, @NotNull @NotNull Map<String, Object> objectMap) 输出自定义模板文件- 参数:
customFiles- 自定义模板文件列表tableInfo- 表信息objectMap- 渲染数据- 从以下版本开始:
- 3.5.3
-
outputEntity
protected void outputEntity(@NotNull @NotNull TableInfo tableInfo, @NotNull @NotNull Map<String, Object> objectMap) 输出实体文件- 参数:
tableInfo- 表信息objectMap- 渲染数据- 从以下版本开始:
- 3.5.0
-
getOutputFile
-
outputMapper
protected void outputMapper(@NotNull @NotNull TableInfo tableInfo, @NotNull @NotNull Map<String, Object> objectMap) 输出Mapper文件(含xml)- 参数:
tableInfo- 表信息objectMap- 渲染数据- 从以下版本开始:
- 3.5.0
-
outputService
protected void outputService(@NotNull @NotNull TableInfo tableInfo, @NotNull @NotNull Map<String, Object> objectMap) 输出service文件- 参数:
tableInfo- 表信息objectMap- 渲染数据- 从以下版本开始:
- 3.5.0
-
outputController
protected void outputController(@NotNull @NotNull TableInfo tableInfo, @NotNull @NotNull Map<String, Object> objectMap) 输出controller文件- 参数:
tableInfo- 表信息objectMap- 渲染数据- 从以下版本开始:
- 3.5.0
-
outputFile
protected void outputFile(@NotNull @NotNull File file, @NotNull @NotNull Map<String, Object> objectMap, @NotNull @NotNull String templatePath, boolean fileOverride) 输出文件- 参数:
file- 文件objectMap- 渲染信息templatePath- 模板路径fileOverride- 是否覆盖已有文件- 从以下版本开始:
- 3.5.2
-
getTemplateFilePath
@NotNull protected @NotNull Optional<String> getTemplateFilePath(@NotNull @NotNull Function<TemplateConfig, String> function) 获取模板路径- 参数:
function- function- 返回:
- 模板路径
- 从以下版本开始:
- 3.5.0
-
getPathInfo
获取路径信息- 参数:
outputFile- 输出文件- 返回:
- 路径信息
-
batchOutput
批量输出 java xml 文件 -
writer
@NotNull public abstract void writer(@NotNull @NotNull Map<String, Object> objectMap, @NotNull @NotNull String templatePath, @NotNull @NotNull File outputFile) throws Exception将模板转化成为文件- 参数:
objectMap- 渲染对象 MAP 信息templatePath- 模板文件outputFile- 文件生成的目录- 抛出:
Exception- 异常- 从以下版本开始:
- 3.5.0
-
open
public void open()打开输出目录 -
getObjectMap
@NotNull public @NotNull Map<String,Object> getObjectMap(@NotNull @NotNull ConfigBuilder config, @NotNull @NotNull TableInfo tableInfo) 渲染对象 MAP 信息- 参数:
config- 配置信息tableInfo- 表信息对象- 返回:
- ignore
-
templateFilePath
模板真实文件路径- 参数:
filePath- 文件路径- 返回:
- ignore
-
isCreate
检查文件是否创建文件- 参数:
file- 文件fileOverride- 是否覆盖已有文件- 返回:
- 是否创建文件
- 从以下版本开始:
- 3.5.2
-
suffixJavaOrKt
文件后缀 -
getConfigBuilder
-
setConfigBuilder
@NotNull public @NotNull AbstractTemplateEngine setConfigBuilder(@NotNull @NotNull ConfigBuilder configBuilder)
-