类 FreemarkerUtils
java.lang.Object
org.tio.utils.freemarker.FreemarkerUtils
这个代码在不违背开源协议的前提下摘自:https://gitee.com/sanluan/PublicCMS-preview/blob/master/publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/FreeMarkerUtils.java
感谢publiccms作者张向东同志^_^
- 作者:
- tanyaowu 2017年11月13日 下午3:09:21
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidgenerateFileByFile(String templateFilePath, String destFilePath, freemarker.template.Configuration configuration, Object model) static voidgenerateFileByFile(String templateFilePath, String destFilePath, freemarker.template.Configuration configuration, Object model, boolean override) static voidgenerateFileByFile(String templateFilePath, String destFilePath, freemarker.template.Configuration configuration, Object model, boolean override, boolean append) static voidgenerateStringByPath(Writer writer, String template, freemarker.template.Configuration configuration, Object model) static StringgenerateStringByPath(String template, freemarker.template.Configuration configuration) static StringgenerateStringByPath(String template, freemarker.template.Configuration configuration, Object model) static StringgenerateStringByString(String templateContent, freemarker.template.Configuration configuration, Object model)
-
字段详细资料
-
DEFAULT_CHARSET
- 另请参阅:
-
-
构造器详细资料
-
FreemarkerUtils
public FreemarkerUtils()
-
-
方法详细资料
-
generateFileByFile
public static void generateFileByFile(String templateFilePath, String destFilePath, freemarker.template.Configuration configuration, Object model) throws IOException, freemarker.template.TemplateException - 参数:
templateFilePath-destFilePath-configuration-model-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
generateFileByFile
public static void generateFileByFile(String templateFilePath, String destFilePath, freemarker.template.Configuration configuration, Object model, boolean override) throws IOException, freemarker.template.TemplateException - 参数:
templateFilePath-destFilePath-configuration-model-override-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
generateFileByFile
public static void generateFileByFile(String templateFilePath, String destFilePath, freemarker.template.Configuration configuration, Object model, boolean override, boolean append) throws freemarker.template.MalformedTemplateNameException, freemarker.core.ParseException, IOException, freemarker.template.TemplateException - 参数:
templateFilePath-destFilePath-configuration-model-override-append-- 抛出:
freemarker.core.ParseExceptionfreemarker.template.MalformedTemplateNameExceptionIOExceptionfreemarker.template.TemplateException
-
generateStringByPath
public static String generateStringByPath(String template, freemarker.template.Configuration configuration) throws IOException, freemarker.template.TemplateException - 参数:
template-configuration-- 返回:
- render result
- 抛出:
freemarker.template.TemplateExceptionIOException
-
generateStringByPath
public static String generateStringByPath(String template, freemarker.template.Configuration configuration, Object model) throws IOException, freemarker.template.TemplateException - 参数:
template-configuration-model-- 返回:
- render result
- 抛出:
IOExceptionfreemarker.template.TemplateException
-
generateStringByPath
public static void generateStringByPath(Writer writer, String template, freemarker.template.Configuration configuration, Object model) throws freemarker.template.TemplateNotFoundException, freemarker.template.MalformedTemplateNameException, freemarker.core.ParseException, IOException, freemarker.template.TemplateException - 参数:
writer-template-configuration-model-- 抛出:
freemarker.template.TemplateNotFoundExceptionfreemarker.template.MalformedTemplateNameExceptionfreemarker.core.ParseExceptionIOExceptionfreemarker.template.TemplateException
-
generateStringByString
public static String generateStringByString(String templateContent, freemarker.template.Configuration configuration, Object model) throws IOException, freemarker.template.TemplateException - 参数:
templateContent-configuration-model-- 返回:
- render result
- 抛出:
IOExceptionfreemarker.template.TemplateException
-