|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.config.DefaultConfigurable
org.norther.tammi.spray.engine.AbstractTemplateEngine
org.norther.tammi.spray.velocity.VelocityEngine
public class VelocityEngine
VelocityEngine implements TemplateEngine for Velocity templates.
Note that changes to engine configuration require a restart to become effective.
Based on TurbineVelocityEngine in the Apache Jakarta
Turbine project.
| Field Summary | |
|---|---|
static String |
RESOURCE_LOADER_FINDER_PROPERTY
The resource loader finder property. |
static String |
RESOURCE_LOADER_KEY_PROPERTY
The resource loader key property. |
static String |
RESOURCE_LOADER_PATH_PROPERTY
The resource loader path property. |
static String |
RESOURCE_LOADER_PROPERTY
The resource loader property. |
static String |
TEMPLATE_ENGINE_PROPERTY
The template engine property. |
| Fields inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
MODIFIED, SYNCHRONIZED, UNMODIFIED |
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
VelocityEngine()
Constructs a new engine. |
|
| Method Summary | |
|---|---|
protected org.apache.velocity.app.VelocityEngine |
getEngine()
Gets the Velocity engine. |
protected void |
process(CharSequence content,
TemplateContext context,
String template,
String encoding,
Writer writer)
Subclasses implement this method to process the specified run-time content or target template. |
void |
start()
Starts the MBean. |
void |
stop()
Stops the MBean. |
boolean |
templateExists(String template)
Checks whether a specific template exists. |
| Methods inherited from class org.norther.tammi.spray.engine.AbstractTemplateEngine |
|---|
clearCached, evaluate, evaluate, evaluate, execute, execute, execute, expireCached, expireFraction, getCache, getDefaultEncoding, getRefreshed, getTemplateEncoding, isCachingDisabled, isStarted, refresh, removeCache, resolveLocalizedTemplate, setCachingDisabled, setDefaultEncoding |
| Methods inherited from class org.norther.tammi.core.config.DefaultConfigurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getConfiguration, getModifiedState, getProperties, getProperty, getPropertyFilePath, indexOfProperty, loadConfiguration, loadConfiguration, loadConfiguration, modified, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setModifiedState, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.core.config.Configurable |
|---|
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties |
| Field Detail |
|---|
public static final String TEMPLATE_ENGINE_PROPERTY
public static final String RESOURCE_LOADER_PROPERTY
public static final String RESOURCE_LOADER_KEY_PROPERTY
public static final String RESOURCE_LOADER_PATH_PROPERTY
public static final String RESOURCE_LOADER_FINDER_PROPERTY
| Constructor Detail |
|---|
public VelocityEngine()
| Method Detail |
|---|
public void start()
throws Exception
Startable
start in interface Startablestart in class AbstractTemplateEngineException - if start fails.public void stop()
Startable
stop in interface Startablestop in class AbstractTemplateEnginepublic boolean templateExists(String template)
TemplateEngine
templateExists in interface TemplateEnginetemplateExists in class AbstractTemplateEnginetemplate - the name of the template.
protected void process(CharSequence content,
TemplateContext context,
String template,
String encoding,
Writer writer)
throws TemplateException
AbstractTemplateEngineNote that implementations should catch TemplateBreakExceptions.
process in class AbstractTemplateEnginecontent - optional run-time content.context - the template context.template - the target template.encoding - the template encoding.writer - the content writer.
TemplateException - on errors.protected org.apache.velocity.app.VelocityEngine getEngine()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||