org.melati.app
Class AbstractTemplateApp
java.lang.Object
org.melati.app.AbstractConfigApp
org.melati.app.AbstractPoemApp
org.melati.app.AbstractTemplateApp
- All Implemented Interfaces:
- App
- Direct Known Subclasses:
- DSDApp, TemplateApp
public abstract class AbstractTemplateApp
- extends AbstractPoemApp
- implements App
Base class to use Melati as an application with a Template Engine.
To create your own application simply extend this class,
overriding the doTemplateRequest(org.melati.Melati, org.melati.template.TemplateContext)
method.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
templateEngine
protected TemplateEngine templateEngine
AbstractTemplateApp
public AbstractTemplateApp()
init
public Melati init(String[] args)
throws MelatiException
- Initialise.
- Overrides:
init
in class AbstractPoemApp
- Parameters:
args
- the command line arguments
- Returns:
- a configured Melati
a newly created Melati
- Throws:
MelatiException
- if something goes wrong during initialisation- See Also:
AbstractPoemApp.init(java.lang.String[])
doPoemRequest
protected void doPoemRequest(Melati melati)
throws Exception
- Fulfill
AbstractPoemApp
's promises.
- Specified by:
doPoemRequest
in class AbstractPoemApp
- Parameters:
melati
- the Melati
- Throws:
Exception
- if anything goes wrong- See Also:
AbstractPoemApp.doPoemRequest(org.melati.Melati)
addExtension
protected String addExtension(String templateName)
- The template extension is added in an overridable method
to allow the application developer to specify their own template
extensions.
doTemplateRequest
protected abstract String doTemplateRequest(Melati melati,
TemplateContext templateContext)
throws Exception
- Override this method to build up your own output.
- Parameters:
melati
- the current Melati
templateContext
- the current TemplateContext
- Returns:
- a Template name, possibly excluding extension.
- Throws:
Exception
Copyright © 2000-2010 PanEris. All Rights Reserved.