Class BannerBuilder

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

public class BannerBuilder extends Object
Builds top-banner components across supported layout presets.

Contract: build() returns a new banner component containing either custom content or generated title/subtitle/image content based on the selected layout.

Mutability and thread-safety: mutable and not thread-safe. Use per composition flow and do not share across requests/threads.

  • Method Details

    • create

      public static BannerBuilder create()
      Creates a new builder.
    • withLayout

      public BannerBuilder withLayout(BannerBuilder.BannerLayout layout)
      Set the banner layout mode.
    • withTextAlignment

      public BannerBuilder withTextAlignment(BannerBuilder.TextAlignment alignment)
      Set text alignment (used with IMAGE_OVERLAY layout).
    • withTitle

      public BannerBuilder withTitle(String title)
      Set the banner title.
    • withSubtitle

      public BannerBuilder withSubtitle(String subtitle)
      Set the banner subtitle.
    • withImage

      public BannerBuilder withImage(String imageUrl, String alt)
      Adds an image/logo for HORIZONTAL layout. Building generated horizontal content constructs an Image, applying its source policy then, not at this configuration call. This differs from the raw CSS background-image path.
    • withImageSize

      public BannerBuilder withImageSize(int width, int height)
      Set image dimensions.
    • withBackgroundImage

      public BannerBuilder withBackgroundImage(String imageUrl)
      Sets a background image for IMAGE_OVERLAY. Supply an application-controlled or separately CSS-context-validated value: it is interpolated into a single-quoted CSS url(), without CSS escaping or Image validation. Image's scheme check alone cannot secure CSS syntax.
    • withBackgroundColor

      public BannerBuilder withBackgroundColor(String color)
      Sets a trusted CSS background-color value. Supply application-controlled or separately CSS-context-validated input; raw style assembly does not reject declaration separators.
    • withTextColor

      public BannerBuilder withTextColor(String color)
      Sets a trusted CSS color value. Supply application-controlled or separately CSS-context-validated input; attribute encoding does not prevent CSS declaration breakout.
    • withMinHeight

      public BannerBuilder withMinHeight(int height)
      Set minimum height in pixels (useful for IMAGE_OVERLAY).
    • withClass

      public BannerBuilder withClass(String className)
      Add custom CSS class.
    • withCustomContent

      public BannerBuilder withCustomContent(Component content)
      Add custom content to the banner (overrides title/subtitle).
    • build

      public Component build()
      Builds a new banner component snapshot from current configuration.