接口 FreeMarkerUtil

所有已知实现类:
FreeMarkerUtilImpl

public interface FreeMarkerUtil
FreeMarker工具类接口
作者:
BW.Panda Dec 8, 2016
  • 方法详细资料

    • setMode

      void setMode(Mode mode)
      设置工具类的使用模式。 工具类的模式默认为 Mode.RUN 运行模式
      参数:
      mode - 使用模式
      另请参阅:
    • process

      boolean process(String templateName, Map<String,Object> dataModel, String fullFileName)
      使用模板生成文件
      参数:
      templateName - 模板名称
      dataModel - 数据模型
      fullFileName - 要生成的文件的绝对路径。
      返回:
      boolean true -- 成功, false -- 失败
    • process

      boolean process(String templateName, Map<String,Object> dataModel, Writer out)
      把模板生成的信息放入指定的输出流中
      参数:
      templateName - 模板名称
      dataModel - 数据模型
      out - 输出流
      返回:
      boolean true -- 成功, false -- 失败
    • processWeb

      boolean processWeb(String templateName, Map<String,Object> dataModel)
      处理web请求
      参数:
      templateName - 模板名, 无需增加后缀(.ftl)
      dataModel - 数据模型。 默认在模型中增加上下文路径对象 bp
      返回:
      boolean true -- 成功, false -- 失败
    • processWeb

      boolean processWeb(String templateName)
      处理web请求
      参数:
      templateName - 模板名, 无需增加后缀(.ftl)
      返回:
      boolean true -- 成功, false -- 失败
    • process2Str

      String process2Str(String templateName, Map<String,Object> dataModel)
      合并模板和数据,并将结果以字符串形式返回。
      参数:
      templateName - 模板名
      rootMap - 数据:可以是JavaBean,也可以是Map。
      返回:
      String