Class SideNavBuilder

java.lang.Object
io.mindspice.simplypages.builders.SideNavBuilder

public class SideNavBuilder extends Object
Builds a SideNav with ordered sections and links.

Contract: generated links include HTMX navigation attributes and target #content-area unless overridden with withContentTarget(String).

Mutability and thread-safety: mutable and not thread-safe. Use per request/setup flow and do not mutate concurrently.

  • Method Details

    • create

      public static SideNavBuilder create()
      Creates a new builder.
    • addSection

      public SideNavBuilder addSection(String title)
      Appends a section header entry.
    • addLink

      public SideNavBuilder addLink(String name, String path)
      Appends a non-active link without an icon. Path must be application-controlled or separately validated for navigation and hx-get; no Link scheme policy is applied.
    • addLink

      public SideNavBuilder addLink(String name, String path, boolean active)
      Appends a link with explicit active state and no icon. Path must be application-controlled or separately navigation/endpoint-validated; encoding does not enforce destination policy.
    • addLink

      public SideNavBuilder addLink(String name, String path, String icon)
      Appends a non-active link with an icon and an application-controlled or separately navigation/endpoint-validated path; no Link scheme policy is applied.
    • addLink

      public SideNavBuilder addLink(String name, String path, boolean active, String icon)
      Appends a link with explicit active state and icon. Path is encoded into href and hx-get, not scheme-validated; supply an application-controlled or separately validated destination.
    • withContentTarget

      public SideNavBuilder withContentTarget(String target)
      Sets the HTMX target used for generated links.
    • build

      public SideNav build()
      Builds a new SideNav snapshot from current entries.