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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendWithNoWrap(CharSequence text) Append text from the given builder.static HtmlTextBuilderCreates and instance of builder which outputs light html if full html was not appended.protected voidpreferLightHtml(HtmlTextBuilder builder) prependWithNoWrap(CharSequence plainText) Add text to the beginning.replaceSpaceToNbsp(String text) protected StringtoAppendableText(String text) toString()Methods inherited from class com.nomagic.text.builders.AbstractTextBuilder
append, appendColor, appendToText, isTextAdded, prepend, prependColor, prependToText, replaceText, setText, textLengthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
toAppendableTextin classAbstractTextBuilder<T extends HtmlTextBuilder>
-
prependWithNoWrap
Description copied from interface:TextBuilderAdd 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:TextBuilderAppend 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:
toStringin interfaceTextBuilder<T extends HtmlTextBuilder>- Overrides:
toStringin 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
-