public class PrettyStringBuilder extends IndentingStringBuilder
sb| Constructor and Description |
|---|
PrettyStringBuilder(java.lang.StringBuilder sb,
int indentSpaces)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
IndentingStringBuilder |
addComment(java.lang.String comment)
Add a c-style comment.
|
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.
|
public PrettyStringBuilder(java.lang.StringBuilder sb,
int indentSpaces)
sb - the StringBuilder to write toindentSpaces - how many spaces to use for indentationpublic IndentingStringBuilder nextLine()
IndentingStringBuildernextLine in class IndentingStringBuilderpublic 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 addComment(java.lang.String comment)
IndentingStringBuilderaddComment in class IndentingStringBuildercomment - the comment