org.webmacro.resource
Class TemplatePathTemplateLoader
java.lang.Object
org.webmacro.resource.AbstractTemplateLoader
org.webmacro.resource.TemplatePathTemplateLoader
- All Implemented Interfaces:
- TemplateLoader
- public class TemplatePathTemplateLoader
- extends AbstractTemplateLoader
Implementation of TemplateLoader that loads templates from a list of
paths specified in the TemplatePath setting. This template loader
is for compatability with old WebMacro.properties configurations, that
still use a TemplatePath setting.
- Author:
- Sebastian Kanthak (sebastian.kanthak@muehlheim.de)
Method Summary |
Template |
load(java.lang.String query,
CacheElement ce)
Try to load a template. |
void |
setConfig(java.lang.String config)
Set the config options for this template loader. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TemplatePathTemplateLoader
public TemplatePathTemplateLoader()
setConfig
public void setConfig(java.lang.String config)
throws InitException
- Description copied from interface:
TemplateLoader
- Set the config options for this template loader.
The config option is the path after the colon (":") in
the TemplatePath setting for this loader.
This can be an path as well as JDBC settings or something
completely different.
- Parameters:
config
- config options for this template loader
- Throws:
InitException
load
public final Template load(java.lang.String query,
CacheElement ce)
throws ResourceException
- Description copied from interface:
TemplateLoader
- Try to load a template.
This method will create and return a template found in the location
described by query or return null, if no such template exists. If
a resource is found at the location, but no template could be created
for some reason, a ResourceException is thrown.
If the cache element ce is not null, this method should set a reload
context on the cache element to enable
reload-on-demand for this template. If ce is null, caching is disabled.
- Parameters:
query
- location to load template fromce
- cache element that will be used for this template or null
if no cache is used.
- Throws:
ResourceException
- if an error occured while loading the template