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