Class BannerBuilder
java.lang.Object
io.mindspice.simplypages.builders.BannerBuilder
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumLayout mode for the banner.static enumText alignment for overlay banners. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new banner component snapshot from current configuration.static BannerBuildercreate()Creates a new builder.withBackgroundColor(String color) Sets a trusted CSS background-color value.withBackgroundImage(String imageUrl) Sets a background image for IMAGE_OVERLAY.Add custom CSS class.withCustomContent(Component content) Add custom content to the banner (overrides title/subtitle).Adds an image/logo for HORIZONTAL layout.withImageSize(int width, int height) Set image dimensions.withLayout(BannerBuilder.BannerLayout layout) Set the banner layout mode.withMinHeight(int height) Set minimum height in pixels (useful for IMAGE_OVERLAY).withSubtitle(String subtitle) Set the banner subtitle.withTextAlignment(BannerBuilder.TextAlignment alignment) Set text alignment (used with IMAGE_OVERLAY layout).withTextColor(String color) Sets a trusted CSS color value.Set the banner title.
-
Method Details
-
create
Creates a new builder. -
withLayout
Set the banner layout mode. -
withTextAlignment
Set text alignment (used with IMAGE_OVERLAY layout). -
withTitle
Set the banner title. -
withSubtitle
Set the banner subtitle. -
withImage
Adds an image/logo for HORIZONTAL layout. Building generated horizontal content constructs anImage, applying its source policy then, not at this configuration call. This differs from the raw CSS background-image path. -
withImageSize
Set image dimensions. -
withBackgroundImage
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
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
Sets a trusted CSS color value. Supply application-controlled or separately CSS-context-validated input; attribute encoding does not prevent CSS declaration breakout. -
withMinHeight
Set minimum height in pixels (useful for IMAGE_OVERLAY). -
withClass
Add custom CSS class. -
withCustomContent
Add custom content to the banner (overrides title/subtitle). -
build
Builds a new banner component snapshot from current configuration.
-