Package com.nomagic.text.builders
Class AbstractTextBuilder<T extends AbstractTextBuilder>
java.lang.Object
com.nomagic.text.builders.AbstractTextBuilder<T>
- All Implemented Interfaces:
 TextBuilder<T>
- Direct Known Subclasses:
 HtmlTextBuilder,PlainOrFullHtmlTextBuilder,PlainOrLightHtmlTextBuilder,PlainTextBuilder,RichTextBuilder
@OpenApiAll
public abstract class AbstractTextBuilder<T extends AbstractTextBuilder>
extends Object
implements TextBuilder<T>
Abstract builder.
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionappend(CharSequence text) Append given textprotected StringappendColor(String text) protected final voidappendToText(String text) booleanprepend(CharSequence text) Add given text to the beginning.protected StringprependColor(String text) protected final voidprependToText(String text) protected final voidreplaceText(String text) voidsetText(CharSequence text) Replace current text with the given oneprotected final intprotected StringtoAppendableText(String text) toString()Methods 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, appendWithNoWrap, appendWithSpace, appendWithSpace, compress, isColorSupported, isPlainTextEmpty, prepend, prependWithNoWrap, setColor, setText, toPlainText 
- 
Constructor Details
- 
AbstractTextBuilder
public AbstractTextBuilder() 
 - 
 - 
Method Details
- 
isTextAdded
public boolean isTextAdded()- Specified by:
 isTextAddedin interfaceTextBuilder<T extends AbstractTextBuilder>- Returns:
 - true if at least one text fragment was added (even if fragment is empty)
 
 - 
append
Description copied from interface:TextBuilderAppend given text- Specified by:
 appendin interfaceTextBuilder<T extends AbstractTextBuilder>- Parameters:
 text- text to append- Returns:
 - this builder
 
 - 
prepend
Description copied from interface:TextBuilderAdd given text to the beginning.- Specified by:
 prependin interfaceTextBuilder<T extends AbstractTextBuilder>- Parameters:
 text- text to append- Returns:
 - this builder
 
 - 
appendColor
 - 
prependColor
 - 
setText
Description copied from interface:TextBuilderReplace current text with the given one- Specified by:
 setTextin interfaceTextBuilder<T extends AbstractTextBuilder>- Parameters:
 text- text
 - 
toString
- Specified by:
 toStringin interfaceTextBuilder<T extends AbstractTextBuilder>- Overrides:
 toStringin classObject- Returns:
 - result string
 
 - 
appendToText
 - 
prependToText
 - 
textLength
protected final int textLength() - 
replaceText
 - 
toAppendableText
 
 -