Class MustacheMixin.Builder
- All Implemented Interfaces:
ViewMixinBuilder<MustacheMixin.Builder>
- Enclosing class:
- MustacheMixin
MustacheMixin.
Mirrors MustacheDispatcher.Builder's configuration methods on its own surface and
forwards each call into a held MustacheDispatcher.Builder (worker-bean
composition). Implements ViewMixinBuilder so basePath(String) and
cacheTemplates(boolean) are guaranteed to transfer to the sibling JSP / Thymeleaf /
FreeMarker bridge builders.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor — package access forMustacheMixin.create(). -
Method Summary
Modifier and TypeMethodDescriptionSets the classpath base path under which template resources are resolved.build()Builds theMustacheMixin.cacheTemplates(boolean value) Sets whether the bridge's default factory caches compiled templates.Reads the current base path setting (test/inspection helper).Reads the current template-suffix setting (test/inspection helper).booleanReads the current cache-templates setting (test/inspection helper).templateSuffix(String value) Sets the suffix to append to template names that don't already end with it (idempotent).
-
Constructor Details
-
Builder
protected Builder()Constructor — package access forMustacheMixin.create().
-
-
Method Details
-
basePath
Sets the classpath base path under which template resources are resolved.Defaults to
"/". A typical configured value is"/templates/"— the same Spring-Boot-compatible layout convention the sibling JSP / Thymeleaf bridges use.- Specified by:
basePathin interfaceViewMixinBuilder<MustacheMixin.Builder>- Parameters:
value- The base path.nullor blank values reset to the defaultMustacheMixin.DEFAULT_BASE_PATH.- Returns:
- This object.
-
templateSuffix
Sets the suffix to append to template names that don't already end with it (idempotent).Defaults to
""(no implicit suffix — literal template names). Typical configured value is".mustache", the mustache.java convention.- Parameters:
value- The new suffix.nullresets toMustacheMixin.DEFAULT_TEMPLATE_SUFFIX.- Returns:
- This object.
-
cacheTemplates
Sets whether the bridge's default factory caches compiled templates.Defaults to
true(cache forever — production-safe). Setfalseto enable dev hot-reload (the bridge rebuilds the factory from a fresh, empty compile-cache on every render). This setting only applies to the bridge's fallback factory; if aMustacheFactorybean is registered, its own caching behavior is honored.- Specified by:
cacheTemplatesin interfaceViewMixinBuilder<MustacheMixin.Builder>- Parameters:
value- The new value.- Returns:
- This object.
-
getBasePath
Reads the current base path setting (test/inspection helper).- Returns:
- The base path. Never
null.
-
getTemplateSuffix
Reads the current template-suffix setting (test/inspection helper).- Returns:
- The template suffix. Never
null.
-
isCacheTemplates
Reads the current cache-templates setting (test/inspection helper).- Returns:
- The cache flag.
-
build
Builds theMustacheMixin.- Returns:
- A new
MustacheMixininstance.
-