Class Paragraph

java.lang.Object
io.mindspice.simplypages.core.HtmlTag
io.mindspice.simplypages.components.Paragraph
All Implemented Interfaces:
Component

public class Paragraph extends HtmlTag
Paragraph component with alignment class management helpers.

Text/alignment configuration is mutable and must finish before sharing. Rendering derives alignment classes without changing stored attributes or children. Compiled templates retain this renderer as a live delegate, so later configuration is reflected in their output. Custom child renderers and request contexts retain their own sharing requirements.

  • Constructor Details

    • Paragraph

      public Paragraph(String text)
    • Paragraph

      public Paragraph()
  • Method Details

    • getText

      public String getText()
    • getAlignment

      public String getAlignment()
    • withId

      public Paragraph withId(String id)
      Sets the HTML id attribute for this paragraph.
      Overrides:
      withId in class HtmlTag
      Parameters:
      id - the HTML id attribute value
      Returns:
      this Paragraph for method chaining
    • withClass

      public Paragraph withClass(String className)
      Description copied from class: HtmlTag
      Overrides:
      withClass in class HtmlTag
    • left

      public Paragraph left()
      Aligns paragraph text to the left (default).
    • center

      public Paragraph center()
      Aligns paragraph text to the center.
    • right

      public Paragraph right()
      Aligns paragraph text to the right.
    • justify

      public Paragraph justify()
      Justifies paragraph text.
    • render

      public String render(RenderContext context)
      Description copied from class: HtmlTag
      Renders opening tag, text payload, child output, and closing tag.

      Security contract: slot and plain text are escaped; trusted HTML payload is emitted verbatim.

      Specified by:
      render in interface Component
      Overrides:
      render in class HtmlTag
      Parameters:
      context - context used for slot resolution and render policy
      Returns:
      rendered HTML for this component
    • render

      public String render()
      Description copied from interface: Component
      Renders this component with an empty context.
      Returns:
      rendered HTML for this component