Package com.nomagic.text.builders
Class HtmlTextBuilder<T extends HtmlTextBuilder>
java.lang.Object
com.nomagic.text.builders.AbstractTextBuilder<T>
com.nomagic.text.builders.HtmlTextBuilder<T>
- All Implemented Interfaces:
TextBuilder<T>
- Direct Known Subclasses:
ColoredHtmlTextBuilder
A builder used for html text building. Plain or rich text fragments will be transformed to html text. Colored fragments are not supported.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappendWithNoWrap
(CharSequence text) Append text from the given builder.static HtmlTextBuilder
Creates and instance of builder which outputs light html if full html was not appended.protected void
preferLightHtml
(HtmlTextBuilder builder) prependWithNoWrap
(CharSequence plainText) Add text to the beginning.replaceSpaceToNbsp
(String text) protected String
toAppendableText
(String text) toString()
Methods inherited from class com.nomagic.text.builders.AbstractTextBuilder
append, appendColor, appendToText, isTextAdded, prepend, prependColor, prependToText, replaceText, setText, textLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.nomagic.text.builders.TextBuilder
append, appendWithSpace, appendWithSpace, compress, isColorSupported, isPlainTextEmpty, prepend, setColor, setText
-
Constructor Details
-
HtmlTextBuilder
public HtmlTextBuilder()
-
-
Method Details
-
toAppendableText
- Overrides:
toAppendableText
in classAbstractTextBuilder<T extends HtmlTextBuilder>
-
prependWithNoWrap
Description copied from interface:TextBuilder
Add text to the beginning. Added text will not be wrapped if builder supports that.- Parameters:
plainText
- text to prepend- Returns:
- this builder
-
appendWithNoWrap
Description copied from interface:TextBuilder
Append text from the given builder. Added text will not be wrapped if builder supports that.- Parameters:
text
- text to prepend- Returns:
- this builder
-
replaceSpaceToNbsp
-
toPlainText
- Returns:
- result string as plain text
-
toString
- Specified by:
toString
in interfaceTextBuilder<T extends HtmlTextBuilder>
- Overrides:
toString
in classAbstractTextBuilder<T extends HtmlTextBuilder>
- Returns:
- result string
-
createHtmlTextBuilderPreferLightHtml
Creates and instance of builder which outputs light html if full html was not appended.- Returns:
- builder
-
preferLightHtml
-