org.apache.turbine.services.template
Class BaseTemplateEngineService
java.lang.Object
org.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.turbine.services.template.BaseTemplateEngineService
- All Implemented Interfaces:
- Initable, Service, TemplateEngineService
- Direct Known Subclasses:
- TurbineJspService, TurbineVelocityService
- public abstract class BaseTemplateEngineService
- extends TurbineBaseService
- implements TemplateEngineService
The base implementation of Turbine TemplateEngineService
.
- Version:
- $Id: BaseTemplateEngineService.java 264148 2005-08-29 14:21:04Z henning $
- Author:
- Daniel Rall, Jason van Zyl
Method Summary |
java.lang.String[] |
getAssociatedFileExtensions()
Supplies the file extension to key this engine in TemplateService 's
registry with. |
java.util.Hashtable |
getTemplateEngineServiceConfiguration()
Return the configuration of the template engine in
the form of a Hashtable. |
protected void |
initConfiguration(java.lang.String defaultExt)
Initialize the Template Engine Service. |
void |
registerConfiguration(java.lang.String defaultExt)
Initializes file extension associations and registers with the
template service. |
abstract boolean |
templateExists(java.lang.String template)
Use the specific template engine to determine whether
a given template exists. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseTemplateEngineService
public BaseTemplateEngineService()
registerConfiguration
public void registerConfiguration(java.lang.String defaultExt)
- Description copied from interface:
TemplateEngineService
- Initializes file extension associations and registers with the
template service.
- Specified by:
registerConfiguration
in interface TemplateEngineService
- Parameters:
defaultExt
- The default file extension association to use
in case of properties file misconfiguration.- See Also:
TemplateEngineService.registerConfiguration(java.lang.String)
getTemplateEngineServiceConfiguration
public java.util.Hashtable getTemplateEngineServiceConfiguration()
- Description copied from interface:
TemplateEngineService
- Return the configuration of the template engine in
the form of a Hashtable.
- Specified by:
getTemplateEngineServiceConfiguration
in interface TemplateEngineService
- See Also:
TemplateEngineService.getTemplateEngineServiceConfiguration()
getAssociatedFileExtensions
public java.lang.String[] getAssociatedFileExtensions()
- Description copied from interface:
TemplateEngineService
- Supplies the file extension to key this engine in
TemplateService
's
registry with.
- Specified by:
getAssociatedFileExtensions
in interface TemplateEngineService
- See Also:
TemplateEngineService.getAssociatedFileExtensions()
initConfiguration
protected void initConfiguration(java.lang.String defaultExt)
- Initialize the Template Engine Service.
Note engine file extension associations. First attempts to
pull a list of custom extensions from the property file value
keyed by
template.extension
. If none are defined,
uses the value keyed by
template.default.extension
, defaulting to the
emergency value supplied by defaultExt
.
- Parameters:
defaultExt
- The default used when the default defined in the
properties file is missing or misconfigured.
templateExists
public abstract boolean templateExists(java.lang.String template)
- Description copied from interface:
TemplateEngineService
- Use the specific template engine to determine whether
a given template exists. This allows Turbine the TemplateService
to delegate the search for a template to the template
engine being used for the view. This gives us the
advantage of fully utilizing the capabilities of
template engine with respect to retrieving templates
from arbitrary sources.
- Specified by:
templateExists
in interface TemplateEngineService
- Parameters:
template
- The name of the template to check the existance of.
- Returns:
- Whether the specified template exists.
- See Also:
TemplateEngineService.templateExists(java.lang.String)
Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.