Class CalloutModule

All Implemented Interfaces:
Component

public class CalloutModule extends Module
Module for highlighted informational callout blocks.

Mutability and thread-safety: mutable and not thread-safe. Content/type flags are mutable configuration state; mutate within a request-scoped flow. For reuse, stop mutating and render as a stable structure with per-request slot/context values.

  • Constructor Details

    • CalloutModule

      public CalloutModule()
  • Method Details

    • create

      public static CalloutModule create()
    • withTitle

      public CalloutModule withTitle(String title)
      Description copied from class: Module
      Sets optional title consumed by Module.buildContent() implementations.
      Overrides:
      withTitle in class Module
    • withModuleId

      public CalloutModule withModuleId(String moduleId)
      Description copied from class: Module
      Sets module id and synchronizes the underlying id attribute.
      Overrides:
      withModuleId in class Module
    • withContent

      public CalloutModule withContent(String content)
      Sets the callout content.
      Parameters:
      content - the text content
    • withCustomContent

      public CalloutModule withCustomContent(Component content)
      Sets custom component content.
      Parameters:
      content - custom component
    • info

      public CalloutModule info()
      Sets info type (blue, informational).
    • warning

      public CalloutModule warning()
      Sets warning type (yellow, caution).
    • success

      public CalloutModule success()
      Sets success type (green, positive).
    • error

      public CalloutModule error()
      Sets error type (red, negative).
    • note

      public CalloutModule note()
      Sets note type (gray, neutral).
    • withIcon

      public CalloutModule withIcon(String icon)
      Sets a custom icon for the callout.
      Parameters:
      icon - icon class or HTML
    • dismissible

      public CalloutModule dismissible()
      Makes the callout dismissible with a close button.
    • buildContent

      protected void buildContent()
      Description copied from class: Module
      Composes module structure.

      Called at most once by Module.build() unless Module.rebuildContent() is invoked. Do not rely on this method for per-request mutation.

      Specified by:
      buildContent in class Module