|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.melati.template.AbstractTemplateEngine
org.melati.template.velocity.VelocityTemplateEngine
public class VelocityTemplateEngine
Wrapper for the Velocity Template Engine for use with Melati.
| Field Summary | |
|---|---|
static java.lang.String |
NAME
The name of the engine. |
| Fields inherited from class org.melati.template.AbstractTemplateEngine |
|---|
roots |
| Constructor Summary | |
|---|---|
VelocityTemplateEngine()
Constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
expandedTemplate(Template template,
TemplateContext templateContext)
Expand the Template against the context to a String. |
void |
expandTemplate(MelatiWriter out,
java.lang.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. |
java.lang.Object |
getEngine()
Get the underlying engine. |
java.lang.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 java.util.Properties |
loadConfiguration()
|
Template |
template(java.lang.String templateName)
Get a template by name. |
java.lang.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 java.lang.String NAME
| Constructor Detail |
|---|
public VelocityTemplateEngine()
| Method Detail |
|---|
public void init(MelatiConfig melatiConfig)
throws TemplateEngineException
init in interface TemplateEnginemelatiConfig - a MelatiConfig
TemplateEngineException - if any problem occurs with the engineprotected java.util.Properties loadConfiguration()
public TemplateContext getTemplateContext(Melati melati)
getTemplateContext in interface TemplateEnginemelati - the Melati
TemplateContextpublic java.lang.String getName()
getName in interface TemplateEnginepublic java.lang.String templateExtension()
templateExtension in interface TemplateEngine
public Template template(java.lang.String templateName)
throws NotFoundException
template in interface TemplateEnginetemplateName - the name of the template to find
NotFoundException - if template not found
public void expandTemplate(MelatiWriter out,
java.lang.String templateName,
TemplateContext templateContext)
throws java.io.IOException,
NotFoundException
expandTemplate in interface TemplateEngineout - a MelatiWriter to output ontemplateName - the name of the template to expandtemplateContext - the TemplateContext to expand the template against
java.io.IOException - if TemplateEngine does
NotFoundException - if template not found
public void expandTemplate(MelatiWriter out,
Template template,
TemplateContext templateContext)
throws java.io.IOException
Template against the context.
expandTemplate in interface TemplateEngineout - a MelatiWriter to output ontemplate - the Template to expandtemplateContext - the TemplateContext to expand the template against
java.io.IOException - if TemplateEngine does
public java.lang.String expandedTemplate(Template template,
TemplateContext templateContext)
throws java.io.IOException
expandedTemplate in interface TemplateEnginetemplate - the Template to expandtemplateContext - the TemplateContext to expand the template against
java.io.IOException - if TemplateEngine doesTemplateEngine.expandedTemplate(org.melati.template.Template, org.melati.template.TemplateContext)public MelatiStringWriter getStringWriter()
MelatiStringWriter.
getStringWriter in interface TemplateEngineMelatiStringWriter.Melati.getStringWriter(),
TemplateEngine.getStringWriter()public java.lang.Object getEngine()
getEngine in interface TemplateEngine
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||