java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.format.TextBuilder |
Known Direct Subclasses |
A text buffer builder supporting indentation. Can be seen as an alternative to StringBuilder to easily create structured documents.
This class may be sub-classed, in particular, refer to XmlBuilder
for XML documents.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TextBuilder()
Create a builder with a default indentation size of 4 characters and an initial capacity of
16 characters.
| |||||||||||
TextBuilder(int indentationSize)
Create a builder with an initial capacity of 16 characters.
| |||||||||||
TextBuilder(int indentationSize, int initialCapacity)
Create a builder.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TextBuilder | append(long v) | ||||||||||
TextBuilder | append(char v) | ||||||||||
TextBuilder | append(byte v) | ||||||||||
TextBuilder | append(short v) | ||||||||||
TextBuilder | append(Object o) | ||||||||||
TextBuilder | append(double v) | ||||||||||
TextBuilder | append(float v) | ||||||||||
TextBuilder | append(int v) | ||||||||||
TextBuilder | append(String format, Object... args) | ||||||||||
TextBuilder | append(CharSequence csq, int start, int end) | ||||||||||
TextBuilder | append(CharSequence csq) | ||||||||||
TextBuilder | appendLine(boolean noIndent) | ||||||||||
TextBuilder | appendLine(String format, Object... args) | ||||||||||
TextBuilder | appendLine() | ||||||||||
void | clear() | ||||||||||
TextBuilder | eol() | ||||||||||
TextBuilder | indent() | ||||||||||
TextBuilder | indent(boolean followedByEol) | ||||||||||
int | length() | ||||||||||
void | removeChar(int pos) | ||||||||||
void | removeChars(int start, int end) | ||||||||||
void | removeLastChar() | ||||||||||
void | removeLastLine() | ||||||||||
TextBuilder | space() | ||||||||||
String | toString() | ||||||||||
TextBuilder | unindent() | ||||||||||
void | updateIndentation(boolean doIndent) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Appendable
|
Create a builder with a default indentation size of 4 characters and an initial capacity of 16 characters.
Create a builder with an initial capacity of 16 characters.
Create a builder.