|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TemplateEngine
TemplateEngine is an interface to template engines, such as Velocity, WebMacro, FreeMarker, and JSP.
The template engine can be configured through a property file, which is passed to the implementation of the engine.
Based on TemplateEngineService
in the Apache Jakarta Turbine
project.
Method Summary | |
---|---|
CharSequence |
evaluate(CharSequence content,
TemplateContext context,
String template)
Evaluates the given run-time content. |
CharSequence |
evaluate(TemplateContext context,
String template)
Evaluates the specified template. |
CharSequence |
evaluate(TemplateContext context,
String template,
String encoding)
Evaluates the specified template using the given encoding. |
void |
execute(CharSequence content,
TemplateContext context,
String template,
Writer writer)
Executes the given run-time content. |
void |
execute(TemplateContext context,
String template,
String encoding,
Writer writer)
Executes the specified template using the given encoding. |
void |
execute(TemplateContext context,
String template,
Writer writer)
Executes the specified template. |
String |
getDefaultEncoding()
Gets the default encoding to apply when not explicitly specified. |
String |
resolveLocalizedTemplate(String template,
Locale locale)
Resolves a localized template name. |
void |
setDefaultEncoding(String encoding)
Sets the default encoding to apply when not explicitly specified. |
boolean |
templateExists(String template)
Checks whether a specific template exists. |
Methods inherited from interface org.norther.tammi.core.config.Configurable |
---|
addProperty, addProperty, addPropertyFilePath, addPropertyFilePath, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, getPropertyFilePaths, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, removePropertyFilePath, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, setPropertyFilePaths, setPropertyFilePaths, storeProperties |
Methods inherited from interface org.norther.tammi.core.base.Startable |
---|
isStarted, start, stop |
Method Detail |
---|
String getDefaultEncoding()
void setDefaultEncoding(String encoding)
encoding
- the default encoding.boolean templateExists(String template)
template
- the name of the template.
String resolveLocalizedTemplate(String template, Locale locale)
template
- the name of the template.locale
- the locale to apply.
CharSequence evaluate(CharSequence content, TemplateContext context, String template) throws TemplateException
content
- the content.context
- the context.template
- a virtual template for identifying the content.
TemplateException
- if processing fails.CharSequence evaluate(TemplateContext context, String template) throws TemplateException
context
- the context.template
- the name of the template.
TemplateException
- if processing fails.CharSequence evaluate(TemplateContext context, String template, String encoding) throws TemplateException
context
- the context.template
- the name of the template.encoding
- an optional template encoding.
TemplateException
- if processing fails.void execute(CharSequence content, TemplateContext context, String template, Writer writer) throws TemplateException
content
- the content.context
- the context.template
- a virtual template for identifying the content.writer
- a writer for the result.
TemplateException
- if processing fails.void execute(TemplateContext context, String template, Writer writer) throws TemplateException
context
- the context.template
- the name of the template.writer
- a writer for the result.
TemplateException
- if processing fails.void execute(TemplateContext context, String template, String encoding, Writer writer) throws TemplateException
context
- the context.template
- the name of the template.encoding
- an optional template encoding.writer
- a writer for the result.
TemplateException
- if processing fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |