Class HtmlText

java.lang.Object
guideme.web.html.HtmlNode
guideme.web.html.HtmlText

public final class HtmlText extends HtmlNode
A text node. Its content is escaped when written.
  • Constructor Details

    • HtmlText

      public HtmlText(String content)
  • Method Details

    • name

      public String name()
      Description copied from class: HtmlNode
      Returns the name of the HTML tag or an empty string for text nodes.
      Specified by:
      name in class HtmlNode
      Returns:
      the name of the HTML tag or an empty string for text nodes
    • content

      public String content()
    • textContent

      public String textContent()
      Description copied from class: HtmlNode
      Returns the text of this node and its descendants, without markup.
      Specified by:
      textContent in class HtmlNode
      Returns:
      the text of this node and its descendants, without markup
    • outerHtml

      public String outerHtml()
      Description copied from class: HtmlNode
      Returns the HTML of this node and its descendants.
      Specified by:
      outerHtml in class HtmlNode
      Returns:
      the HTML of this node and its descendants
    • attribute

      public @Nullable String attribute(String name)
      Description copied from class: HtmlNode
      Returns the value of the attribute, or null if it isn't set or has no value.
      Specified by:
      attribute in class HtmlNode
      Returns:
      the value of the attribute, or null if it isn't set or has no value
    • setAttribute

      public HtmlTag setAttribute(String name, @Nullable String value)
      Description copied from class: HtmlNode
      Sets an attribute. A null value writes the attribute without a value (i.e. <details open>).
      Specified by:
      setAttribute in class HtmlNode
    • children

      public List<HtmlNode> children()
      Specified by:
      children in class HtmlNode