Module org.htmlunit

Class HtmlSerializerInnerOuterText.HtmlSerializerTextBuilder

java.lang.Object
org.htmlunit.html.serializer.HtmlSerializerInnerOuterText.HtmlSerializerTextBuilder
Enclosing class:
HtmlSerializerInnerOuterText

protected static class HtmlSerializerInnerOuterText.HtmlSerializerTextBuilder extends Object
Helper to compose the text for the serializer based on several modes.
  • Constructor Details

    • HtmlSerializerTextBuilder

      public HtmlSerializerTextBuilder()
      Ctor.
  • Method Details

    • appendRequiredLineBreak

      public void appendRequiredLineBreak()
      Append a required line break (count 1).
    • appendRequiredLineBreak

      public void appendRequiredLineBreak(int count)
      Append a required line break count; consecutive required line breaks are merged to the biggest one. Required line breaks at the start or the end are dropped.
      Parameters:
      count - the number of line breaks
    • appendLineBreak

      public void appendLineBreak()
      Append a line break that is part of the content (like the one from a br element).
    • appendAtomicInline

      public void appendAtomicInline()
      Marks the position of an atomic inline (like an input or image); this element has no text, but white space before and after is not collapsed.
    • appendTab

      public void appendTab()
      Append a tab (used to separate table cells).
    • append

      Append the provided content. see https://drafts.csswg.org/css-text-3/#white-space
      Parameters:
      content - the content to add
      mode - the HtmlSerializerInnerOuterText.HtmlSerializerTextBuilder.Mode
    • getText

      public String getText()
      Returns the constructed text.
      Returns:
      the constructed text.