public interface TemplateEngine extends TemplateContextOperator
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_BEAN_NAME
默认的bean配置名称
|
getTemplateContext, put
static final String DEFAULT_BEAN_NAME
boolean isSafeVariable()
void setSafeVariable(boolean safeVariable)
boolean isCheckModified()
void setCheckModified(boolean checkModified)
checkModified
- boolean isCompactMode()
void setCompactMode(boolean compactMode)
compactMode
- I18nVisitor getI18nVisitor()
TemplateEngine setI18nVisitor(I18nVisitor i18nVistor)
i18nVistor
- TemplateEngine addTemplateFunction(TemplateFunction function)
function
- TemplateFunction getTemplateFunction(String methodName)
methodName
- 注册的方法名TemplateFunction getTemplateFunction(Object object, String methodName)
methodName
- 注册的方法名String getEncode()
TemplateEngine setEncode(String encode)
encode
- boolean isLocaleTemplateEnable()
void setLocaleTemplateEnable(boolean localeTemplateEnable)
localeTemplateEnable
- TemplateEngine addResourceLoader(ResourceLoader resourceLoader)
resourceLoader
- List<ResourceLoader> getResourceLoaderList()
void setResourceLoaderList(List<ResourceLoader> resourceLoaderList)
resourceLoaderList
- void renderMacro(String macroName, Template template, TemplateContext context, OutputStream outputStream) throws IOException, TemplateException
macroName
- 要执行的宏名称template
- 调用宏的模板context
- 上下文outputStream
- 输出器IOException
TemplateException
void renderMacro(Macro macro, Template template, TemplateContext context, OutputStream outputStream) throws IOException, TemplateException
macro
- 要执行的宏template
- 调用宏的模板context
- 上下文outputStream
- 输出器IOException
TemplateException
void renderTemplate(String path, TemplateContext context, OutputStream outputStream) throws TemplateException
path
- 模板对应的路径context
- 上下文outputStream
- 输出器TemplateException
void renderTemplateWithOutLayout(String path, TemplateContext context, OutputStream outputStream) throws TemplateException
path
- context
- outputStream
- TemplateException
void renderTemplate(String path) throws TemplateException
path
- TemplateException
void renderTemplate(Template template) throws TemplateException
template
- TemplateException
void renderTemplate(Template template, TemplateContext context, OutputStream outputStream) throws TemplateException
template
- 要渲染的模板context
- 上下文outputStream
- 输出器TemplateException
Macro findMacro(Object macroName, Template template, TemplateContext context) throws TemplateException
macroName
- template
- context
- TemplateException
Template findTemplate(String path) throws TemplateException
path
- TemplateException
void removeTemplate(String path) throws TemplateException
path
- TemplateException
Object executeFunction(Template template, TemplateContext context, String functionName, Object... parameters) throws TemplateException
functionName
- parameters
- TemplateException
String getResourceContent(String path, String encode) throws TemplateException
path
- TemplateException
String getResourceContent(String path) throws TemplateException
path
- TemplateException
void registerMacroLibrary(String path) throws TemplateException
path
- TemplateException
void registerMacro(Macro macro) throws TemplateException
macro
- TemplateException
void registerMacroLibrary(Template template) throws TemplateException
template
- TemplateException
void write(OutputStream outputStream, Object data) throws TemplateException
TemplateException
void registerStaticClassOperator(StaticClassOperator operator) throws TemplateException
TemplateException
StaticClassOperator getStaticClassOperator(String name) throws TemplateException
name
- TemplateException
Template findTemplateCache(String path) throws TemplateException
path
- TemplateException
Template findTemplateCache(String path, String absolutePath) throws TemplateException
path
- TemplateException
void addTemplateCache(String path, Template template) throws TemplateException
path
- template
- TemplateException
void removeTemplateCache(String path, String absolutePath) throws TemplateException
path
- absolutePath
- TemplateException
Macro findMacroCache(String macroName) throws TemplateException
macroName
- TemplateException
void addMacroCache(String macroName, Macro macro) throws TemplateException
macroName
- macro
- TemplateException
void removeMacroCache(String macroName, String absolutePath) throws TemplateException
macroName
- absolutePath
- TemplateException
Copyright © 2006–2018 TinyGroup. All rights reserved.