Module org.htmlunit
Package org.htmlunit.html.serializer
Class HtmlSerializerVisibleText.HtmlSerializerTextBuilder
java.lang.Object
org.htmlunit.html.serializer.HtmlSerializerVisibleText.HtmlSerializerTextBuilder
- Enclosing class:
- HtmlSerializerVisibleText
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(String content, HtmlSerializerVisibleText.HtmlSerializerTextBuilder.Mode mode) Append the provided content.voidAppend a blank.voidAppend a block separator.voidAppend a break.getText()voidResets the contentAdded state to false.voidRemove all trailing whitespace from the end.boolean
-
Constructor Details
-
HtmlSerializerTextBuilder
public HtmlSerializerTextBuilder()Ctor.
-
-
Method Details
-
append
Append the provided content. see https://drafts.csswg.org/css-text-3/#white-space- Parameters:
content- the content to addmode- theHtmlSerializerVisibleText.HtmlSerializerTextBuilder.Mode
-
appendBlockSeparator
public void appendBlockSeparator()Append a block separator. -
appendBreak
Append a break.- Parameters:
mode- theHtmlSerializerVisibleText.HtmlSerializerTextBuilder.Mode
-
appendBlank
public void appendBlank()Append a blank. -
trimRight
Remove all trailing whitespace from the end.- Parameters:
mode- theHtmlSerializerVisibleText.HtmlSerializerTextBuilder.Mode
-
wasContentAdded
public boolean wasContentAdded()- Returns:
- true if some content was already added
-
resetContentAdded
public void resetContentAdded()Resets the contentAdded state to false. -
getText
- Returns:
- the constructed text.
-