public interface Indentation
Indentation represents all strings necessary to perform consistent
indentation of structured strings.
An Indentation may choose to have no visible effect, in which case calling any other method of the
Indentation has no effect.
| Modifier and Type | Field and Description |
|---|---|
static Indentation |
DEFAULT
A
WhitespaceIndentation, using single tab
character, to default to, if no specific Indentation is given. |
| Modifier and Type | Method and Description |
|---|---|
void |
appendTo(Appendable appendable,
int level)
Appends the string that needs to be appended at the beginning of a line,
with the result that the the line is indented by the given level, to the
given
Appendable |
void |
appendTo(Appendable appendable,
int level,
boolean includeLineBreak)
Appends the string that needs to be appended at the beginning of a line,
with the result that the the line is indented by the given level or the
string that needs to be appended at the end of a line, with the result
that the next line is indented by the given level, including the
necessary line break characters, to the given
Appendable. |
String |
get(int level)
Returns the string that needs to be appended at the beginning of a line,
with the result that the the line is indented by the given level.
|
String |
get(int level,
boolean includeLineBreak)
Returns the string that needs to be appended at the beginning of a line,
with the result that the the line is indented by the given level or the
string that needs to be appended at the end of a line, with the result
that the next line is indented by the given level, including the
necessary line break characters.
|
String |
getLineBreak()
returns the line break string used by this
Indentation. |
boolean |
isVisible()
Returns whether this
Indentation has any visible effect or if
every indentation string is the empty
string. |
static final Indentation DEFAULT
WhitespaceIndentation, using single tab
character, to default to, if no specific Indentation is given.boolean isVisible()
Indentation has any visible effect or if
every indentation string is the empty
string.Indentation has any visible effect.String getLineBreak()
Indentation.Indentation.String get(int level) throws IllegalArgumentException
The result is never null, even if this Indentation is
not visible.
level - The indentation level.IllegalArgumentException - If the given level is negative.String get(int level, boolean includeLineBreak) throws IllegalArgumentException
The line break characters are omitted, if this Indentation is not
visible.
The result is never null, even if this Indentation is
not visible.
level - The indentation level.includeLineBreak - Whether to include the line break characters.IllegalArgumentException - If the given level is negative.void appendTo(Appendable appendable, int level) throws IllegalArgumentException, IOException
Appendableappendable - The Appendable to be used.level - The indentation level.IllegalArgumentException - If the given Appendable is null or if the
given level is negative.IOException - If appending to the given Appendable failed.void appendTo(Appendable appendable, int level, boolean includeLineBreak) throws IllegalArgumentException, IOException
Appendable.
The line break characters are omitted, if this Indentation is not
visible.
appendable - The Appendable to be used.level - The indentation level.includeLineBreak - Whether to include the line break characters.IllegalArgumentException - If the given Appendable is null or if the
given level is negative.IOException - If appending to the given Appendable failed.Copyright © 2016 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.