|
||||||||||
| 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.freemarker.FreemarkerEngine
public class FreemarkerEngine
FreemarkerEngine implements TemplateEngine for Freemarker templates.
Note that changes to engine configuration require a restart to become effective.
| Field Summary | |
|---|---|
static String |
FREEMARKER_PROPERTY_PREFIX
The freemarker property prefix. |
static String |
LOGGER_NAME_PREFIX
The logger name prefix. |
static String |
RESOURCE_LOADER_CLASS_PROPERTY
The resource loader class property. |
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. |
| 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 | |
|---|---|
FreemarkerEngine()
Constructs a new engine. |
|
| Method Summary | |
|---|---|
protected Configuration |
getFreemarker()
Gets the Freemarker configuration. |
protected DefaultTemplateLoader |
getTemplateLoader()
Gets the template loader. |
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 FREEMARKER_PROPERTY_PREFIX
public static final String RESOURCE_LOADER_PROPERTY
public static final String RESOURCE_LOADER_CLASS_PROPERTY
public static final String RESOURCE_LOADER_KEY_PROPERTY
public static final String RESOURCE_LOADER_FINDER_PROPERTY
public static final String RESOURCE_LOADER_PATH_PROPERTY
public static final String LOGGER_NAME_PREFIX
| Constructor Detail |
|---|
public FreemarkerEngine()
| 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 DefaultTemplateLoader getTemplateLoader()
protected Configuration getFreemarker()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||