public class TemplateRenderDefault extends Object implements TemplateRender
DEFAULT_BEAN_NAME
Constructor and Description |
---|
TemplateRenderDefault() |
Modifier and Type | Method and Description |
---|---|
TemplateEngine |
getTemplateEngine() |
String |
renderTemplate(String path,
TemplateContext context)
根据路径渲染一个模板文件,如果有布局会同时渲染布局,返回字符串
|
void |
renderTemplate(String path,
TemplateContext context,
OutputStream outputStream)
根据路径渲染一个模板文件,如果有布局会同时渲染布局
|
String |
renderTemplateContent(String content,
TemplateContext context)
根据文本内容渲染,返回字符串
|
void |
renderTemplateContent(String content,
TemplateContext context,
OutputStream outputStream)
根据文本内容渲染
|
String |
renderTemplateWithOutLayout(String path,
TemplateContext context)
根据路径渲染一个模板文件,但不会渲染布局,返回字符串
|
void |
renderTemplateWithOutLayout(String path,
TemplateContext context,
OutputStream outputStream)
根据路径渲染一个模板文件,但不会渲染布局
|
void |
setTemplateEngine(TemplateEngine engine) |
public TemplateEngine getTemplateEngine()
getTemplateEngine
in interface TemplateRender
public void setTemplateEngine(TemplateEngine engine)
setTemplateEngine
in interface TemplateRender
public void renderTemplate(String path, TemplateContext context, OutputStream outputStream) throws TemplateException
TemplateRender
renderTemplate
in interface TemplateRender
path
- 模板对应的路径context
- 上下文outputStream
- 输出器TemplateException
public String renderTemplate(String path, TemplateContext context) throws TemplateException
TemplateRender
renderTemplate
in interface TemplateRender
TemplateException
public void renderTemplateWithOutLayout(String path, TemplateContext context, OutputStream outputStream) throws TemplateException
TemplateRender
renderTemplateWithOutLayout
in interface TemplateRender
TemplateException
public String renderTemplateWithOutLayout(String path, TemplateContext context) throws TemplateException
TemplateRender
renderTemplateWithOutLayout
in interface TemplateRender
TemplateException
public void renderTemplateContent(String content, TemplateContext context, OutputStream outputStream) throws TemplateException
TemplateRender
renderTemplateContent
in interface TemplateRender
TemplateException
public String renderTemplateContent(String content, TemplateContext context) throws TemplateException
TemplateRender
renderTemplateContent
in interface TemplateRender
TemplateException
Copyright © 2006–2018 TinyGroup. All rights reserved.