Class MustacheDispatcher.Builder
java.lang.Object
org.apache.juneau.rest.server.view.mustache.MustacheDispatcher.Builder
- Enclosing class:
- MustacheDispatcher
Builder for
MustacheDispatcher.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder()Constructor — package access forMustacheDispatcher.create(). -
Method Summary
Modifier and TypeMethodDescriptionSets the classpath base path under which template resources are resolved.build()Builds theMustacheDispatcher.cacheTemplates(boolean value) Sets whether the bridge-defaultMustacheFactorycaches 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 forMustacheDispatcher.create().
-
-
Method Details
-
basePath
Sets the classpath base path under which template resources are resolved.- Parameters:
value- The base path.nullor blank values reset to the defaultMustacheDispatcher.DEFAULT_BASE_PATH.- Returns:
- This object.
-
templateSuffix
Sets the suffix to append to template names that don't already end with it (idempotent).- Parameters:
value- The new suffix.nullresets toMustacheDispatcher.DEFAULT_TEMPLATE_SUFFIX.- Returns:
- This object.
-
cacheTemplates
Sets whether the bridge-defaultMustacheFactorycaches compiled templates.Defaults to
true(cache forever — production-safe). Setfalseto enable dev hot-reload (every render rebuilds the factory from a fresh, empty compile-cache).This flag only affects the bridge-default factory; a user-supplied
@Bean MustacheFactoryis not modified.- Parameters:
value- The cache flag.- 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 theMustacheDispatcher.- Returns:
- A new
MustacheDispatcherinstance.
-