Class TemplateEngines
- java.lang.Object
-
- org.jbake.template.TemplateEngines
-
public class TemplateEngines extends java.lang.ObjectA singleton class giving access to rendering engines. Rendering engines are loaded based on classpath. New rendering may be registered either at runtime (not recommanded) or by putting a descriptor file on classpath (recommanded).
The descriptor file must be found in META-INF directory and named org.jbake.parser.TemplateEngines.properties. The format of the file is easy:
org.jbake.parser.FreeMarkerRenderer=ftl
org.jbake.parser.GroovyRenderer=groovy,gsp
where the key is the class of the engine (must extend
AbstractTemplateEngineand have a 4-arg constructor and the value is a comma-separated list of file extensions that this engine is capable of proceeding.Rendering engines are singletons, so are typically used to initialize the underlying template engines.
This class loads the engines only if they are found on classpath. If not, the engine is not registered. This allows JBake to support multiple rendering engines without the explicit need to have them on classpath. This is a better fit for embedding.
-
-
Constructor Summary
Constructors Constructor Description TemplateEngines(JBakeConfiguration config, ContentStore db)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractTemplateEnginegetEngine(java.lang.String fileExtension)java.util.Set<java.lang.String>getRecognizedExtensions()
-
-
-
Constructor Detail
-
TemplateEngines
public TemplateEngines(JBakeConfiguration config, ContentStore db)
-
-
Method Detail
-
getRecognizedExtensions
public java.util.Set<java.lang.String> getRecognizedExtensions()
-
getEngine
public AbstractTemplateEngine getEngine(java.lang.String fileExtension)
-
-