public class PlainStringBuilder extends IndentingStringBuilder
IndentingStringBuilder that ignores formatting
commands, or only emits single whitespaces as appropriate.
Just a plain wrapper for a StringBuilder.sb| Constructor and Description |
|---|
PlainStringBuilder(java.lang.StringBuilder sb)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
IndentingStringBuilder |
addComment(java.lang.String comment)
Add a c-style comment.
|
IndentingStringBuilder |
append(char c)
Append a char.
|
IndentingStringBuilder |
append(java.lang.String s)
Append a String.
|
IndentingStringBuilder |
nextLine()
Emit a newline, along with any necessary indentation.
|
IndentingStringBuilder |
popIndent()
Remove a level of indentation.
|
IndentingStringBuilder |
pushIndent()
Add a new level of indentation.
|
append, length, toStringpublic PlainStringBuilder(java.lang.StringBuilder sb)
sb - the StringBuilder to write topublic IndentingStringBuilder append(java.lang.String s)
IndentingStringBuilderappend in class IndentingStringBuilders - the string to appendpublic IndentingStringBuilder append(char c)
IndentingStringBuilderappend in class IndentingStringBuilderc - the char to appendpublic IndentingStringBuilder pushIndent()
IndentingStringBuilderIndentingStringBuilder.nextLine().pushIndent in class IndentingStringBuilderpublic IndentingStringBuilder popIndent()
IndentingStringBuilderIndentingStringBuilder.nextLine().
It is an error to unindent when there are no levels of indentation active;
this is indicated with a call to IndentingStringBuilder.addComment(String) with a warning
that the caller has unindented too much.popIndent in class IndentingStringBuilderpublic IndentingStringBuilder nextLine()
IndentingStringBuildernextLine in class IndentingStringBuilderpublic IndentingStringBuilder addComment(java.lang.String comment)
IndentingStringBuilderaddComment in class IndentingStringBuildercomment - the comment