public class VelocityEngine extends Object implements TemplateEngine
Constructor and Description |
---|
VelocityEngine()
默认构造
|
VelocityEngine(TemplateConfig config)
构造
|
VelocityEngine(org.apache.velocity.app.VelocityEngine engine)
构造
|
Modifier and Type | Method and Description |
---|---|
org.apache.velocity.app.VelocityEngine |
getRawEngine()
获取原始的引擎对象
|
Template |
getTemplate(String resource)
获取模板
|
TemplateEngine |
init(TemplateConfig config)
使用指定配置文件初始化模板引擎
|
public VelocityEngine()
public VelocityEngine(TemplateConfig config)
config
- 模板配置public VelocityEngine(org.apache.velocity.app.VelocityEngine engine)
engine
- VelocityEngine
public TemplateEngine init(TemplateConfig config)
TemplateEngine
init
in interface TemplateEngine
config
- 配置文件public org.apache.velocity.app.VelocityEngine getRawEngine()
public Template getTemplate(String resource)
TemplateEngine
getTemplate
in interface TemplateEngine
resource
- 资源,根据实现不同,此资源可以是模板本身,也可以是模板的相对路径Copyright © 2024. All rights reserved.