Class ListItem

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

public class ListItem extends HtmlTag
Mutable list item wrapper with escaped text content.

Configure before sharing; rendering does not mutate the text payload.

  • Constructor Details

    • ListItem

      public ListItem()
  • Method Details

    • create

      public static ListItem create()
    • create

      public static ListItem create(String text)
    • withId

      public ListItem withId(String id)
      Sets the HTML id attribute for this list item.
      Overrides:
      withId in class HtmlTag
      Parameters:
      id - the HTML id attribute value
      Returns:
      this ListItem for method chaining
    • withText

      public ListItem withText(String text)
    • getText

      public String getText()
    • 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