接口 FreeMarkerUtil
- 所有已知实现类:
FreeMarkerUtilImpl
public interface FreeMarkerUtil
FreeMarker工具类接口
- 作者:
- BW.Panda Dec 8, 2016
-
方法概要
修饰符和类型方法说明boolean把模板生成的信息放入指定的输出流中boolean使用模板生成文件process2Str(String templateName, Map<String, Object> dataModel) 合并模板和数据,并将结果以字符串形式返回。booleanprocessWeb(String templateName) 处理web请求booleanprocessWeb(String templateName, Map<String, Object> dataModel) 处理web请求void设置工具类的使用模式。 工具类的模式默认为Mode.RUN运行模式
-
方法详细资料
-
setMode
设置工具类的使用模式。 工具类的模式默认为Mode.RUN运行模式- 参数:
mode- 使用模式- 另请参阅:
-
process
使用模板生成文件- 参数:
templateName- 模板名称dataModel- 数据模型fullFileName- 要生成的文件的绝对路径。- 返回:
booleantrue-- 成功,false-- 失败
-
process
把模板生成的信息放入指定的输出流中- 参数:
templateName- 模板名称dataModel- 数据模型out- 输出流- 返回:
booleantrue-- 成功,false-- 失败
-
processWeb
处理web请求- 参数:
templateName- 模板名, 无需增加后缀(.ftl)dataModel- 数据模型。 默认在模型中增加上下文路径对象bp- 返回:
booleantrue-- 成功,false-- 失败
-
processWeb
处理web请求- 参数:
templateName- 模板名, 无需增加后缀(.ftl)- 返回:
booleantrue-- 成功,false-- 失败
-
process2Str
合并模板和数据,并将结果以字符串形式返回。- 参数:
templateName- 模板名rootMap- 数据:可以是JavaBean,也可以是Map。- 返回:
String
-