org.melati.template
Class AbstractTemplateEngine

Package class diagram package AbstractTemplateEngine
java.lang.Object
  extended by org.melati.template.AbstractTemplateEngine
All Implemented Interfaces:
TemplateEngine
Direct Known Subclasses:
NoTemplateEngine, VelocityTemplateEngine, WebmacroTemplateEngine

public abstract class AbstractTemplateEngine
extends Object
implements TemplateEngine

Common elements of a TemplateEngine.


Field Summary
protected  Vector<String> roots
           
 
Constructor Summary
AbstractTemplateEngine()
          Constructor.
 
Method Summary
 void addRoot(String root)
          Add root at index 0, so that the empty string is always returned last by elements.
 Enumeration<String> getRoots()
          A root should not end in a slash.
 String getTemplateName(String key, String classifier)
          The name of a template which exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.melati.template.TemplateEngine
expandedTemplate, expandTemplate, expandTemplate, getEngine, getName, getStringWriter, getTemplateContext, init, template, templateExtension
 

Field Detail

roots

protected Vector<String> roots
Constructor Detail

AbstractTemplateEngine

public AbstractTemplateEngine()
Constructor.

Method Detail

getTemplateName

public String getTemplateName(String key,
                              String classifier)
The name of a template which exists.

Specified by:
getTemplateName in interface TemplateEngine
Parameters:
key - short name, without path or extension
classifier - a purpose or database name or similar qualifier
Returns:
the name of a template, null if none found
See Also:
TemplateEngine.getTemplateName(java.lang.String, java.lang.String)

getRoots

public Enumeration<String> getRoots()
A root should not end in a slash.

Specified by:
getRoots in interface TemplateEngine
Returns:
an Enumeration of string roots, always at least the empty string
See Also:
TemplateEngine.getRoots()

addRoot

public void addRoot(String root)
Add root at index 0, so that the empty string is always returned last by elements.

Specified by:
addRoot in interface TemplateEngine
Parameters:
root - the root to add
See Also:
TemplateEngine.addRoot(java.lang.String)


Copyright © 2000-2010 PanEris. All Rights Reserved.