Package org.jbake.template
Class AbstractTemplateEngine
- java.lang.Object
-
- org.jbake.template.AbstractTemplateEngine
-
- Direct Known Subclasses:
DelegatingTemplateEngine,FreemarkerTemplateEngine,GroovyMarkupTemplateEngine,GroovyTemplateEngine,JadeTemplateEngine,PebbleTemplateEngine,ThymeleafTemplateEngine
public abstract class AbstractTemplateEngine extends java.lang.ObjectA template is responsible for converting a model into a rendered document. The model consists of key/value pairs, some of them potentially converted from a markup language to HTML already.An appropriate rendering engine will be chosen by JBake based on the template suffix. If contents is not available in the supplied model, a template has access to the document database in order to complete the model. It is in particular interesting to optimize data access based on the underlying template engine capabilities.
Note that some rendering engines may rely on a different rendering model than the one provided by the first argument of
renderDocument(TemplateModel, String, Writer). In this case, it is the responsibility of the engine to convert it.
-
-
Field Summary
Fields Modifier and Type Field Description protected JBakeConfigurationconfigprotected ContentStoredbprotected static ModelExtractorsextractors
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTemplateEngine(org.apache.commons.configuration2.Configuration config, ContentStore db, java.io.File destination, java.io.File templatesPath)protectedAbstractTemplateEngine(JBakeConfiguration config, ContentStore db)
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract voidrenderDocument(TemplateModel model, java.lang.String templateName, java.io.Writer writer)
-
-
-
Field Detail
-
extractors
protected static ModelExtractors extractors
-
config
protected final JBakeConfiguration config
-
db
protected final ContentStore db
-
-
Constructor Detail
-
AbstractTemplateEngine
@Deprecated protected AbstractTemplateEngine(org.apache.commons.configuration2.Configuration config, ContentStore db, java.io.File destination, java.io.File templatesPath)
-
AbstractTemplateEngine
protected AbstractTemplateEngine(JBakeConfiguration config, ContentStore db)
-
-
Method Detail
-
renderDocument
public abstract void renderDocument(TemplateModel model, java.lang.String templateName, java.io.Writer writer) throws RenderingException
- Throws:
RenderingException
-
-