|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.melati.template.AbstractTemplateEngine org.melati.template.velocity.VelocityTemplateEngine
public class VelocityTemplateEngine
Wrapper for the Velocity Template Engine for use with Melati.
Field Summary | |
---|---|
static String |
NAME
The name of the engine. |
Fields inherited from class org.melati.template.AbstractTemplateEngine |
---|
roots |
Constructor Summary | |
---|---|
VelocityTemplateEngine()
Constructor. |
Method Summary | |
---|---|
String |
expandedTemplate(Template template,
TemplateContext templateContext)
Expand the Template against the context to a String. |
void |
expandTemplate(MelatiWriter out,
String templateName,
TemplateContext templateContext)
Get a Template by name and expand it against a context. |
void |
expandTemplate(MelatiWriter out,
Template template,
TemplateContext templateContext)
Expand a Template against the context. |
Object |
getEngine()
Get the underlying engine. |
String |
getName()
The name of the template engine (used to find the templets). |
MelatiStringWriter |
getStringWriter()
Return a MelatiStringWriter . |
TemplateContext |
getTemplateContext(Melati melati)
Get the template context for Velocity. |
void |
init(MelatiConfig melatiConfig)
Construct a new Engine. |
protected Properties |
loadConfiguration()
|
Template |
template(String templateName)
Get a template by name. |
String |
templateExtension()
|
Methods inherited from class org.melati.template.AbstractTemplateEngine |
---|
addRoot, getRoots, getTemplateName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.melati.template.TemplateEngine |
---|
addRoot, getRoots, getTemplateName |
Field Detail |
---|
public static final String NAME
Constructor Detail |
---|
public VelocityTemplateEngine()
Method Detail |
---|
public void init(MelatiConfig melatiConfig) throws TemplateEngineException
init
in interface TemplateEngine
melatiConfig
- a MelatiConfig
TemplateEngineException
- if any problem occurs with the engineprotected Properties loadConfiguration()
public TemplateContext getTemplateContext(Melati melati)
getTemplateContext
in interface TemplateEngine
melati
- the Melati
TemplateContext
public String getName()
getName
in interface TemplateEngine
public String templateExtension()
templateExtension
in interface TemplateEngine
public Template template(String templateName) throws NotFoundException
template
in interface TemplateEngine
templateName
- the name of the template to find
NotFoundException
- if template not foundpublic void expandTemplate(MelatiWriter out, String templateName, TemplateContext templateContext) throws NotFoundException
expandTemplate
in interface TemplateEngine
out
- a MelatiWriter
to output ontemplateName
- the name of the template to expandtemplateContext
- the TemplateContext
to expand the template against
NotFoundException
- if template not foundpublic void expandTemplate(MelatiWriter out, Template template, TemplateContext templateContext)
Template
against the context.
expandTemplate
in interface TemplateEngine
out
- a MelatiWriter
to output ontemplate
- the Template
to expandtemplateContext
- the TemplateContext
to expand the template againstpublic String expandedTemplate(Template template, TemplateContext templateContext)
expandedTemplate
in interface TemplateEngine
template
- the Template
to expandtemplateContext
- the TemplateContext
to expand the template against
TemplateEngine.expandedTemplate(org.melati.template.Template, org.melati.template.TemplateContext)
public MelatiStringWriter getStringWriter()
MelatiStringWriter
.
getStringWriter
in interface TemplateEngine
MelatiStringWriter
.Melati.getStringWriter()
,
TemplateEngine.getStringWriter()
public Object getEngine()
getEngine
in interface TemplateEngine
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |