Class ThymeleafMixin.Builder
- All Implemented Interfaces:
ViewMixinBuilder<ThymeleafMixin.Builder>
- Enclosing class:
- ThymeleafMixin
ThymeleafMixin.
Mirrors ThymeleafDispatcher.Builder's configuration methods on its own surface and
forwards each call into a held ThymeleafDispatcher.Builder (worker-bean
composition). Implements ViewMixinBuilder so basePath(String) and
cacheTemplates(boolean) are guaranteed to transfer to the sibling JSP / Mustache /
FreeMarker bridge builders.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor — package access forThymeleafMixin.create(). -
Method Summary
Modifier and TypeMethodDescriptionSets the classpath base path under which template resources are resolved.build()Builds theThymeleafMixin.cacheTemplates(boolean value) Sets whether the bridge's default engine caches resolved templates.Reads the current base path setting (test/inspection helper).org.thymeleaf.templatemode.TemplateModeReads the current template-mode setting (test/inspection helper).booleanReads the current cache-templates setting (test/inspection helper).templateMode(org.thymeleaf.templatemode.TemplateMode value) Sets the template mode used by the bridge's default engine.
-
Constructor Details
-
Builder
protected Builder()Constructor — package access forThymeleafMixin.create().
-
-
Method Details
-
basePath
Sets the classpath base path under which template resources are resolved.Defaults to
"/". A typical configured value is"/templates/"— the Spring-Boot-compatible layout convention.- Specified by:
basePathin interfaceViewMixinBuilder<ThymeleafMixin.Builder>- Parameters:
value- The base path.nullor blank values reset to the defaultThymeleafMixin.DEFAULT_BASE_PATH.- Returns:
- This object.
-
cacheTemplates
Sets whether the bridge's default engine caches resolved templates.Defaults to
true(production-safe). Set tofalseduring development to pick up edits without restarting the server. This setting only applies to the bridge's fallback engine; if aTemplateEnginebean is registered, its own caching configuration is honored.- Specified by:
cacheTemplatesin interfaceViewMixinBuilder<ThymeleafMixin.Builder>- Parameters:
value- The new value.- Returns:
- This object.
-
templateMode
Sets the template mode used by the bridge's default engine.Defaults to
HTML. Other modes (`XML`, `TEXT`, `JAVASCRIPT`, `CSS`, `RAW`) work if the user supplies templates in that mode; engines that want mixed-mode support should register a custom@Bean TemplateEnginewith multiple resolvers instead.- Parameters:
value- The new value.nullresets toThymeleafMixin.DEFAULT_TEMPLATE_MODE.- Returns:
- This object.
-
getBasePath
Reads the current base path setting (test/inspection helper).- Returns:
- The base path. Never
null.
-
isCacheTemplates
Reads the current cache-templates setting (test/inspection helper).- Returns:
- The cache flag.
-
getTemplateMode
Reads the current template-mode setting (test/inspection helper).- Returns:
- The template mode. Never
null.
-
build
Builds theThymeleafMixin.- Returns:
- A new
ThymeleafMixininstance.
-