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 1078552 2011-03-06 19:58:46Z tv $
- Author:
- Daniel Rall, Jason van Zyl
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(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 Hashtable<String,Object> 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 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(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(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-2011 The Apache Software Foundation. All Rights Reserved.