Module org.htmlunit
Package org.htmlunit.html.serializer
Class HtmlSerializerInnerOuterText.HtmlSerializerTextBuilder
java.lang.Object
org.htmlunit.html.serializer.HtmlSerializerInnerOuterText.HtmlSerializerTextBuilder
- Enclosing class:
- HtmlSerializerInnerOuterText
Helper to compose the text for the serializer based on several modes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumMode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend the provided content.voidMarks 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.voidAppend a line break that is part of the content (like the one from a br element).voidAppend a required line break (count 1).voidappendRequiredLineBreak(int count) Append a required line break count; consecutive required line breaks are merged to the biggest one.voidAppend a tab (used to separate table cells).getText()Returns the constructed text.
-
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
public void append(String content, HtmlSerializerInnerOuterText.HtmlSerializerTextBuilder.Mode mode) Append the provided content. see https://drafts.csswg.org/css-text-3/#white-space- Parameters:
content- the content to addmode- theHtmlSerializerInnerOuterText.HtmlSerializerTextBuilder.Mode
-
getText
Returns the constructed text.- Returns:
- the constructed text.
-