public class FreemarkerUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CHARSET |
Constructor and Description |
---|
FreemarkerUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
generateFileByFile(String templateFilePath,
String destFilePath,
freemarker.template.Configuration configuration,
Object model) |
static void |
generateFileByFile(String templateFilePath,
String destFilePath,
freemarker.template.Configuration configuration,
Object model,
boolean override) |
static void |
generateFileByFile(String templateFilePath,
String destFilePath,
freemarker.template.Configuration configuration,
Object model,
boolean override,
boolean append) |
static String |
generateStringByPath(String template,
freemarker.template.Configuration configuration) |
static String |
generateStringByPath(String template,
freemarker.template.Configuration configuration,
Object model) |
static void |
generateStringByPath(Writer writer,
String template,
freemarker.template.Configuration configuration,
Object model) |
static String |
generateStringByString(String templateContent,
freemarker.template.Configuration configuration,
Object model) |
public static final String DEFAULT_CHARSET
public static void generateFileByFile(String templateFilePath, String destFilePath, freemarker.template.Configuration configuration, Object model) throws IOException, freemarker.template.TemplateException
templateFilePath
- destFilePath
- configuration
- model
- IOException
freemarker.template.TemplateException
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
- IOException
freemarker.template.TemplateException
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.ParseException
freemarker.template.MalformedTemplateNameException
IOException
freemarker.template.TemplateException
public static String generateStringByPath(String template, freemarker.template.Configuration configuration) throws IOException, freemarker.template.TemplateException
template
- configuration
- freemarker.template.TemplateException
IOException
public static String generateStringByPath(String template, freemarker.template.Configuration configuration, Object model) throws IOException, freemarker.template.TemplateException
template
- configuration
- model
- IOException
freemarker.template.TemplateException
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.TemplateNotFoundException
freemarker.template.MalformedTemplateNameException
freemarker.core.ParseException
IOException
freemarker.template.TemplateException
public static String generateStringByString(String templateContent, freemarker.template.Configuration configuration, Object model) throws IOException, freemarker.template.TemplateException
templateContent
- configuration
- model
- IOException
freemarker.template.TemplateException
Copyright © 2021. All rights reserved.