public class StringTemplateLoader extends Object implements freemarker.cache.TemplateLoader
String其自身即是模板。| 构造器和说明 |
|---|
StringTemplateLoader()
构造一个采用系统默认Locale的字符串模板加载类。
|
StringTemplateLoader(freemarker.template.Configuration configuration)
构造一个指定Locale的字符串模板加载类。
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
closeTemplateSource(Object templateSource) |
Object |
findTemplateSource(String name)
解析模板名称。
|
long |
getLastModified(Object templateSource) |
Reader |
getReader(Object templateSource,
String encoding) |
void |
setConfiguration(freemarker.template.Configuration configuration)
设置所属Configuration的Locale属性。
|
public StringTemplateLoader()
public StringTemplateLoader(freemarker.template.Configuration configuration)
configuration - 指定的Configuration对象。public final void setConfiguration(freemarker.template.Configuration configuration)
configuration - 指定的Configuration对象。public void closeTemplateSource(Object templateSource) throws IOException
closeTemplateSource 在接口中 freemarker.cache.TemplateLoaderIOExceptionpublic Object findTemplateSource(String name) throws IOException
findTemplateSource 在接口中 freemarker.cache.TemplateLoaderIOException - 如果发生 I/O 错误。Configuration.getLocalizedLookup(),
Configurable.getLocale()public long getLastModified(Object templateSource)
getLastModified 在接口中 freemarker.cache.TemplateLoaderpublic Reader getReader(Object templateSource, String encoding) throws IOException
getReader 在接口中 freemarker.cache.TemplateLoaderIOExceptionCopyright © 2022. All rights reserved.