public interface TemplateEngine extends TemplateContextOperator
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_BEAN_NAME
默认的bean配置名称
|
getTemplateContext, putstatic 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 - 输出器IOExceptionTemplateExceptionvoid renderMacro(Macro macro, Template template, TemplateContext context, OutputStream outputStream) throws IOException, TemplateException
macro - 要执行的宏template - 调用宏的模板context - 上下文outputStream - 输出器IOExceptionTemplateExceptionvoid renderTemplate(String path, TemplateContext context, OutputStream outputStream) throws TemplateException
path - 模板对应的路径context - 上下文outputStream - 输出器TemplateExceptionvoid renderTemplateWithOutLayout(String path, TemplateContext context, OutputStream outputStream) throws TemplateException
path - context - outputStream - TemplateExceptionvoid renderTemplate(String path) throws TemplateException
path - TemplateExceptionvoid renderTemplate(Template template) throws TemplateException
template - TemplateExceptionvoid renderTemplate(Template template, TemplateContext context, OutputStream outputStream) throws TemplateException
template - 要渲染的模板context - 上下文outputStream - 输出器TemplateExceptionMacro findMacro(Object macroName, Template template, TemplateContext context) throws TemplateException
macroName - template - context - TemplateExceptionTemplate findTemplate(String path) throws TemplateException
path - TemplateExceptionvoid removeTemplate(String path) throws TemplateException
path - TemplateExceptionObject executeFunction(Template template, TemplateContext context, String functionName, Object... parameters) throws TemplateException
functionName - parameters - TemplateExceptionString getResourceContent(String path, String encode) throws TemplateException
path - TemplateExceptionString getResourceContent(String path) throws TemplateException
path - TemplateExceptionvoid registerMacroLibrary(String path) throws TemplateException
path - TemplateExceptionvoid registerMacro(Macro macro) throws TemplateException
macro - TemplateExceptionvoid registerMacroLibrary(Template template) throws TemplateException
template - TemplateExceptionvoid write(OutputStream outputStream, Object data) throws TemplateException
TemplateExceptionvoid registerStaticClassOperator(StaticClassOperator operator) throws TemplateException
TemplateExceptionStaticClassOperator getStaticClassOperator(String name) throws TemplateException
name - TemplateExceptionTemplate findTemplateCache(String path) throws TemplateException
path - TemplateExceptionTemplate findTemplateCache(String path, String absolutePath) throws TemplateException
path - TemplateExceptionvoid addTemplateCache(String path, Template template) throws TemplateException
path - template - TemplateExceptionvoid removeTemplateCache(String path, String absolutePath) throws TemplateException
path - absolutePath - TemplateExceptionMacro findMacroCache(String macroName) throws TemplateException
macroName - TemplateExceptionvoid addMacroCache(String macroName, Macro macro) throws TemplateException
macroName - macro - TemplateExceptionvoid removeMacroCache(String macroName, String absolutePath) throws TemplateException
macroName - absolutePath - TemplateExceptionCopyright © 2006–2018 TinyGroup. All rights reserved.