Interface ViewMixinBuilder<B extends ViewMixinBuilder<B>>

Type Parameters:
B - The implementing builder's own concrete type.
All Known Implementing Classes:
ConsoleFreemarkerMixin.Builder, FreemarkerMixin.Builder, JspMixin.Builder, MustacheMixin.Builder, ThymeleafMixin.Builder

public interface ViewMixinBuilder<B extends ViewMixinBuilder<B>>
Minimal shared contract implemented by the builder of every view-engine mixin (JspMixin.Builder, ThymeleafMixin.Builder, MustacheMixin.Builder, FreemarkerMixin.Builder).

The four view-engine bridges each evolved their own builder independently (worker-bean composition), and their per-engine knobs legitimately diverge — e.g. only Thymeleaf exposes templateMode(...), only Mustache/FreeMarker expose templateSuffix(...). This interface pins down the small subset of knobs that are meaningful to every engine, so a caller who has learned one bridge's shape can rely on these two methods transferring to the others without re-reading each bridge's Javadoc.

Implementations return their own concrete builder type from each method so call chains stay fluent (e.g. JspMixin.create().basePath(...).build()); the self-bounded type parameter <B> captures that covariant return type.

Note on cacheTemplates(boolean): not every engine has a real caching knob to back this with. Bridges that can honor it (e.g. Mustache, FreeMarker, Thymeleaf) apply it to their bridge-default engine/factory/configuration. The JSP bridge accepts and reports the flag for interface conformance, but has no effect: JSP recompilation is entirely delegated to the servlet container via RequestDispatcher.forward(...), and containers manage their own JSP recompilation policy (e.g. Tomcat's development / modificationTestInterval settings) outside this bridge's control. See each *Mixin.Builder#cacheTemplates(boolean) override's own Javadoc for the exact per-engine behavior.

See Also:
Since:
10.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Sets the base path under which the engine's template resources are resolved.
    cacheTemplates(boolean value)
    Sets whether the bridge's default engine caches resolved/compiled templates.
  • Method Details

    • basePath

      B basePath(String value)
      Sets the base path under which the engine's template resources are resolved.
      Parameters:
      value - The base path. Bridges treat null / blank as "reset to the bridge's own default".
      Returns:
      This object (for method chaining).
    • cacheTemplates

      B cacheTemplates(boolean value)
      Sets whether the bridge's default engine caches resolved/compiled templates.

      Typically defaults to true (production-safe); set false during development to pick up template edits without restarting the server. See the class-level Javadoc for the JSP-bridge caveat.

      Parameters:
      value - The cache flag.
      Returns:
      This object (for method chaining).