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.
|
Method Summary |
protected java.lang.String |
addExtension(java.lang.String templateName)
The template extension is added in an overridable method
to allow the application developer to specify their own template
extensions. |
protected void |
doPoemRequest(Melati melati)
Fulfill AbstractPoemApp's promises. |
protected abstract java.lang.String |
doTemplateRequest(Melati melati,
TemplateContext templateContext)
Override this method to build up your own output. |
Melati |
init(java.lang.String[] args)
Initialise. |
| 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(java.lang.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 java.lang.Exception
- Fulfill
AbstractPoemApp's promises.
- Specified by:
doPoemRequest in class AbstractPoemApp
- Parameters:
melati - the Melati
- Throws:
java.lang.Exception - if anything goes wrong- See Also:
AbstractPoemApp.doPoemRequest(org.melati.Melati)
addExtension
protected java.lang.String addExtension(java.lang.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 java.lang.String doTemplateRequest(Melati melati,
TemplateContext templateContext)
throws java.lang.Exception
- Override this method to build up your own output.
- Parameters:
melati - the current MelatitemplateContext - the current TemplateContext
- Returns:
- a Template name, possibly excluding extension.
- Throws:
java.lang.Exception
Copyright © 2000-2008 PanEris. All Rights Reserved.