The LJCTextBuilder class is designed for creating text. It can also be
used to create HTML and XML text.
The LJCTextBuilder class stores the built text internally. The text is
retrieved with the ToString() method.
"Append" Methods
"Append Text" methods add the potentially indented and wrapped text to the
builder.
These methods append the supplied text without an ending newline. This
behavior is done for consistency and it allows for appending to the
existing text if desired.
The "Append" methods start the appended text with a newline if the
builder already has text, param allowNewLine = true (default) and the
builder text does not already end with a newline.
"Get" Methods
"Get" methods create and return the potentialy indented and wrapped
text but do not add it to the builder.
This allows for using the text outside of the builder.
Use the "addIndent" parameter set to "false" when appending text to the
builder that was retrieved using a "Get" method. This is because the
indent may already have been added to the text by the "Get" method.
"Add Text" Methods
AddLine(), AddText()
The "Add Text" methods add text to the builder unmodified except for
AddLine() which appends a newline.
"Append Text" Methods
Line(), Text()
The "Append Text" methods add the potentially indented and wrapped text
to the builder. The Line() method appends a newline.
The AddIndent() method manually controls the current indent count.
The indent string length is calculated with the properties
(IndentCount * IndentCharCount) and can be retrieved with the
IndentLength property.
"Get Text" Methods
GetLine(), GetText()
The "Get Text" methods create and return the potentialy indented and
wrapped text but do not add it to the builder.
The GetLine() and GetText() methods modify the returned text the same as
the Line() and Text() methods.
"Append Element" Methods
Begin(), Create(), End()
These methods append element tags and content. Begin() automatically
increments the IndentCount by 1. Create() also increments the IndentCount
by 1 if the isEmpty parameter is false and the close parameter is false.
End() automatically decrements the IndentCount by 1 if the IndentCount
is currently greater than zero.
"Get Element" Methods
GetBegin(), GetCreate(), GetEnd()
The "Get Element" methods create and return the potentialy indented and
wrapped text but do not add it to the builder.
Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.