# Class: com.pnfsoftware.jeb.util.format.TextBuilder

A text buffer builder supporting indentation. Can be seen as an alternative to [StringBuilder](StringBuilder) to easily create structured documents. 

 This class may be sub\-classed, in particular, refer to [XmlBuilder](XmlBuilder) for XML documents.

## Constructor: TextBuilder

Description: Create a builder with a default indentation size of 4 characters and an initial capacity of 16 characters.

## Constructor: TextBuilder
- parameter: `indentationSize`, type: `int`

Description: Create a builder with an initial capacity of 16 characters.
parameter: indentationSize: number of spaces per indentation level

## Constructor: TextBuilder
- parameter: `indentationSize`, type: `int`
- parameter: `initialCapacity`, type: `int`

Description: Create a builder.
parameter: indentationSize: number of spaces per indentation level
parameter: initialCapacity: initial capacity of the underlying character buffer

## Method: append
- parameter: `csq`, type: `java.lang.CharSequence`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`


## Method: append
- parameter: `csq`, type: `java.lang.CharSequence`
- parameter: `start`, type: `int`
- parameter: `end`, type: `int`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`


## Method: append
- parameter: `v`, type: `char`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`


## Method: append
- parameter: `v`, type: `byte`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append a byte value.
parameter: v: value to append
return: this builder

## Method: append
- parameter: `v`, type: `short`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append a short value.
parameter: v: value to append
return: this builder

## Method: append
- parameter: `v`, type: `int`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append an integer value.
parameter: v: value to append
return: this builder

## Method: append
- parameter: `v`, type: `long`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append a long value.
parameter: v: value to append
return: this builder

## Method: append
- parameter: `v`, type: `float`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append a float value.
parameter: v: value to append
return: this builder

## Method: append
- parameter: `v`, type: `double`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append a double value.
parameter: v: value to append
return: this builder

## Method: append
- parameter: `o`, type: `java.lang.Object`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append the string representation of an object.
parameter: o: object to append; null is rendered as `"null"`
return: this builder

## Method: append
- parameter: `format`, type: `java.lang.String`
- parameter: `args`, type: `java.lang.Object[]`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append formatted text.
parameter: format: format string
parameter: args: format arguments
return: this builder

## Method: appendLine
- parameter: `format`, type: `java.lang.String`
- parameter: `args`, type: `java.lang.Object[]`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append formatted text followed by a line separator.
parameter: format: format string
parameter: args: format arguments
return: this builder

## Method: appendLine
- parameter: `noIndent`, type: `boolean`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append a line separator.
parameter: noIndent: true to suppress automatic indentation for the empty line
return: this builder

## Method: appendLine
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append a line separator.
return: this builder

## Method: clear

Description: Clear the buffer content while preserving indentation settings.

## Method: eol
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append a line separator.
return: this builder

## Method: indent
- parameter: `followedByEol`, type: `boolean`
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Increase the indentation level.
parameter: followedByEol: true to append a line separator after changing indentation
return: this builder

## Method: indent
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Increase the indentation level.
return: this builder

## Method: length
- return type: `int`

Description: Get the current number of characters in the buffer.
return: the current buffer length

## Method: removeChar
- parameter: `pos`, type: `int`

Description: Remove one character from the buffer.
parameter: pos: position of the character to remove

## Method: removeChars
- parameter: `start`, type: `int`
- parameter: `end`, type: `int`

Description: Remove a range of characters from the buffer.
parameter: start: start index, inclusive
parameter: end: end index, exclusive

## Method: removeLastChar

Description: Remove the last character from the buffer.

## Method: removeLastLine

Description: Remove the last line from the buffer.

## Method: space
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Append one space character.
return: this builder

## Method: toString
- return type: `java.lang.String`


## Method: unindent
- return type: `com.pnfsoftware.jeb.util.format.TextBuilder`

Description: Decrease the indentation level.
return: this builder
throws: if the indentation level is already zero

## Method: updateIndentation
- parameter: `doIndent`, type: `boolean`

Description: Increase or decrease the current indentation level.
parameter: doIndent: true to indent, false to unindent

