类 AbstractTemplateEngine

    • 字段概要

      字段 
      修饰符和类型 字段 说明
      protected org.slf4j.Logger logger  
    • 方法概要

      所有方法 实例方法 抽象方法 具体方法 已过时的方法 
      修饰符和类型 方法 说明
      @NotNull AbstractTemplateEngine batchOutput()
      批量输出 java xml 文件
      @NotNull ConfigBuilder getConfigBuilder()  
      @NotNull java.util.Map<java.lang.String,​java.lang.Object> getObjectMap​(@NotNull ConfigBuilder config, @NotNull TableInfo tableInfo)
      渲染对象 MAP 信息
      protected @Nullable java.lang.String getPathInfo​(@NotNull OutputFile outputFile)
      获取路径信息
      protected @NotNull java.util.Optional<java.lang.String> getTemplateFilePath​(@NotNull java.util.function.Function<TemplateConfig,​java.lang.String> function)
      获取模板路径
      abstract @NotNull AbstractTemplateEngine init​(@NotNull ConfigBuilder configBuilder)
      模板引擎初始化
      protected boolean isCreate​(@NotNull java.io.File file)
      已过时。
      protected boolean isCreate​(@NotNull java.io.File file, boolean fileOverride)
      检查文件是否创建文件
      protected boolean isCreate​(java.lang.String filePath)
      已过时。
      3.5.0
      void open()
      打开输出目录
      protected void outputController​(@NotNull TableInfo tableInfo, @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
      输出controller文件
      protected void outputCustomFile​(@NotNull java.util.List<CustomFile> customFiles, @NotNull TableInfo tableInfo, @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
      输出自定义模板文件
      protected void outputEntity​(@NotNull TableInfo tableInfo, @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
      输出实体文件
      protected void outputFile​(@NotNull java.io.File file, @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap, @NotNull java.lang.String templatePath)
      已过时。
      protected void outputFile​(@NotNull java.io.File file, @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap, @NotNull java.lang.String templatePath, boolean fileOverride)
      输出文件
      protected void outputMapper​(@NotNull TableInfo tableInfo, @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
      输出Mapper文件(含xml)
      protected void outputService​(@NotNull TableInfo tableInfo, @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
      输出service文件
      @NotNull AbstractTemplateEngine setConfigBuilder​(@NotNull ConfigBuilder configBuilder)  
      protected java.lang.String suffixJavaOrKt()
      文件后缀
      abstract @NotNull java.lang.String templateFilePath​(@NotNull java.lang.String filePath)
      模板真实文件路径
      void writer​(@NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap, @NotNull java.lang.String templatePath, @NotNull java.io.File outputFile)
      将模板转化成为文件
      void writer​(@NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap, @NotNull java.lang.String templatePath, @NotNull java.lang.String outputFile)
      已过时。
      3.5.0
      protected void writerFile​(java.util.Map<java.lang.String,​java.lang.Object> objectMap, java.lang.String templatePath, java.lang.String outputFile)
      已过时。
      3.5.0
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • logger

        protected final org.slf4j.Logger logger
    • 构造器详细资料

      • AbstractTemplateEngine

        public AbstractTemplateEngine()
    • 方法详细资料

      • outputCustomFile

        protected void outputCustomFile​(@NotNull
                                        @NotNull java.util.List<CustomFile> customFiles,
                                        @NotNull
                                        @NotNull TableInfo tableInfo,
                                        @NotNull
                                        @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
        输出自定义模板文件
        参数:
        customFiles - 自定义模板文件列表
        tableInfo - 表信息
        objectMap - 渲染数据
        从以下版本开始:
        3.5.3
      • outputEntity

        protected void outputEntity​(@NotNull
                                    @NotNull TableInfo tableInfo,
                                    @NotNull
                                    @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
        输出实体文件
        参数:
        tableInfo - 表信息
        objectMap - 渲染数据
        从以下版本开始:
        3.5.0
      • outputMapper

        protected void outputMapper​(@NotNull
                                    @NotNull TableInfo tableInfo,
                                    @NotNull
                                    @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
        输出Mapper文件(含xml)
        参数:
        tableInfo - 表信息
        objectMap - 渲染数据
        从以下版本开始:
        3.5.0
      • outputService

        protected void outputService​(@NotNull
                                     @NotNull TableInfo tableInfo,
                                     @NotNull
                                     @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
        输出service文件
        参数:
        tableInfo - 表信息
        objectMap - 渲染数据
        从以下版本开始:
        3.5.0
      • outputController

        protected void outputController​(@NotNull
                                        @NotNull TableInfo tableInfo,
                                        @NotNull
                                        @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap)
        输出controller文件
        参数:
        tableInfo - 表信息
        objectMap - 渲染数据
        从以下版本开始:
        3.5.0
      • outputFile

        @Deprecated
        protected void outputFile​(@NotNull
                                  @NotNull java.io.File file,
                                  @NotNull
                                  @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap,
                                  @NotNull
                                  @NotNull java.lang.String templatePath)
        已过时。
        输出文件(3.5.4版本会删除此方法)
        参数:
        file - 文件
        objectMap - 渲染信息
        templatePath - 模板路径
        从以下版本开始:
        3.5.0
      • outputFile

        protected void outputFile​(@NotNull
                                  @NotNull java.io.File file,
                                  @NotNull
                                  @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap,
                                  @NotNull
                                  @NotNull java.lang.String templatePath,
                                  boolean fileOverride)
        输出文件
        参数:
        file - 文件
        objectMap - 渲染信息
        templatePath - 模板路径
        fileOverride - 是否覆盖已有文件
        从以下版本开始:
        3.5.2
      • getTemplateFilePath

        @NotNull
        protected @NotNull java.util.Optional<java.lang.String> getTemplateFilePath​(@NotNull
                                                                                    @NotNull java.util.function.Function<TemplateConfig,​java.lang.String> function)
        获取模板路径
        参数:
        function - function
        返回:
        模板路径
        从以下版本开始:
        3.5.0
      • getPathInfo

        @Nullable
        protected @Nullable java.lang.String getPathInfo​(@NotNull
                                                         @NotNull OutputFile outputFile)
        获取路径信息
        参数:
        outputFile - 输出文件
        返回:
        路径信息
      • writerFile

        @Deprecated
        protected void writerFile​(java.util.Map<java.lang.String,​java.lang.Object> objectMap,
                                  java.lang.String templatePath,
                                  java.lang.String outputFile)
                           throws java.lang.Exception
        已过时。
        3.5.0
        输出文件(3.5.4版本会删除此方法)
        参数:
        objectMap - 渲染数据
        templatePath - 模板路径
        outputFile - 输出文件
        抛出:
        java.lang.Exception - ex
      • writer

        @Deprecated
        public void writer​(@NotNull
                           @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap,
                           @NotNull
                           @NotNull java.lang.String templatePath,
                           @NotNull
                           @NotNull java.lang.String outputFile)
                    throws java.lang.Exception
        已过时。
        3.5.0
        将模板转化成为文件(3.5.4版本会删除此方法)
        参数:
        objectMap - 渲染对象 MAP 信息
        templatePath - 模板文件
        outputFile - 文件生成的目录
        抛出:
        java.lang.Exception
        另请参阅:
        writer(Map, String, File)
      • writer

        public void writer​(@NotNull
                           @NotNull java.util.Map<java.lang.String,​java.lang.Object> objectMap,
                           @NotNull
                           @NotNull java.lang.String templatePath,
                           @NotNull
                           @NotNull java.io.File outputFile)
                    throws java.lang.Exception
        将模板转化成为文件
        参数:
        objectMap - 渲染对象 MAP 信息
        templatePath - 模板文件
        outputFile - 文件生成的目录
        抛出:
        java.lang.Exception - 异常
        从以下版本开始:
        3.5.0
      • open

        public void open()
        打开输出目录
      • getObjectMap

        @NotNull
        public @NotNull java.util.Map<java.lang.String,​java.lang.Object> getObjectMap​(@NotNull
                                                                                            @NotNull ConfigBuilder config,
                                                                                            @NotNull
                                                                                            @NotNull TableInfo tableInfo)
        渲染对象 MAP 信息
        参数:
        config - 配置信息
        tableInfo - 表信息对象
        返回:
        ignore
      • templateFilePath

        @NotNull
        public abstract @NotNull java.lang.String templateFilePath​(@NotNull
                                                                   @NotNull java.lang.String filePath)
        模板真实文件路径
        参数:
        filePath - 文件路径
        返回:
        ignore
      • isCreate

        @Deprecated
        protected boolean isCreate​(java.lang.String filePath)
        已过时。
        3.5.0
        检测文件是否存在(3.5.4版本会删除此方法)
        返回:
        文件是否存在
      • isCreate

        @Deprecated
        protected boolean isCreate​(@NotNull
                                   @NotNull java.io.File file)
        已过时。
        检查文件是否创建文件(3.5.4版本会删除此方法)
        参数:
        file - 文件
        返回:
        是否创建文件
        从以下版本开始:
        3.5.0
      • isCreate

        protected boolean isCreate​(@NotNull
                                   @NotNull java.io.File file,
                                   boolean fileOverride)
        检查文件是否创建文件
        参数:
        file - 文件
        fileOverride - 是否覆盖已有文件
        返回:
        是否创建文件
        从以下版本开始:
        3.5.2
      • suffixJavaOrKt

        protected java.lang.String suffixJavaOrKt()
        文件后缀
      • getConfigBuilder

        @NotNull
        public @NotNull ConfigBuilder getConfigBuilder()