Class ThymeleafTemplater
java.lang.Object
com.peterphi.std.guice.web.rest.templating.thymeleaf.ThymeleafTemplater
- All Implemented Interfaces:
Templater
Light abstraction over a ThymeLeaf TemplateEngine allowing cleaner construction of the current web context (when the template
engine is being used inside an http call).
Exposes the following special variables:
Exposes the following special variables:
currentUser
- of typeThymeleafCurrentUserUtils
config
- of typeGuiceConfig
-
Constructor Summary
ConstructorDescriptionThymeleafTemplater
(org.thymeleaf.TemplateEngine engine, GuiceConfig configuration, com.codahale.metrics.MetricRegistry metrics, com.google.inject.Provider<CurrentUser> userProvider) ThymeleafTemplater
(org.thymeleaf.TemplateEngine engine, GuiceConfig configuration, com.codahale.metrics.MetricRegistry metrics, com.google.inject.Provider<CurrentUser> userProvider, boolean isTransientInstance) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.thymeleaf.context.AbstractContext
Build a new AbstractContext (exposing the HttpCallContext, where possible)
-
Constructor Details
-
ThymeleafTemplater
@Inject public ThymeleafTemplater(org.thymeleaf.TemplateEngine engine, GuiceConfig configuration, com.codahale.metrics.MetricRegistry metrics, com.google.inject.Provider<CurrentUser> userProvider) -
ThymeleafTemplater
public ThymeleafTemplater(org.thymeleaf.TemplateEngine engine, GuiceConfig configuration, com.codahale.metrics.MetricRegistry metrics, com.google.inject.Provider<CurrentUser> userProvider, boolean isTransientInstance) - Parameters:
engine
- thymeleaf template engine to useconfiguration
- full guice configmetrics
- metricsuserProvider
- user providerisTransientInstance
- if true, will skip registering the TemplateEngine with the CacheManager
-
-
Method Details