public interface TemplateRender
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_BEAN_NAME
默认的bean配置名称
|
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) |
static final String DEFAULT_BEAN_NAME
TemplateEngine getTemplateEngine()
void setTemplateEngine(TemplateEngine engine)
void renderTemplate(String path, TemplateContext context, OutputStream outputStream) throws TemplateException
path
- 模板对应的路径context
- 上下文outputStream
- 输出器TemplateException
String renderTemplate(String path, TemplateContext context) throws TemplateException
path
- context
- TemplateException
void renderTemplateWithOutLayout(String path, TemplateContext context, OutputStream outputStream) throws TemplateException
path
- context
- outputStream
- TemplateException
String renderTemplateWithOutLayout(String path, TemplateContext context) throws TemplateException
path
- context
- TemplateException
void renderTemplateContent(String content, TemplateContext context, OutputStream outputStream) throws TemplateException
content
- context
- outputStream
- TemplateException
String renderTemplateContent(String content, TemplateContext context) throws TemplateException
content
- context
- TemplateException
Copyright © 2006–2018 TinyGroup. All rights reserved.