public abstract class AbstractIndentation extends Object implements Indentation
AbstractIndentation is an Indentation that repeats a given
indentation string.DEFAULT| Constructor and Description |
|---|
AbstractIndentation(String indentationString,
LineBreak lineBreak)
Creates a new
AbstractIndentation. |
AbstractIndentation(String indentationString,
String lineBreakString)
Creates a new
AbstractIndentation. |
| 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. |
public AbstractIndentation(String indentationString, LineBreak lineBreak)
AbstractIndentation.
An AbstractIndentation with level 0 has no visible
effect.
indentationString - The indentation string to be used.lineBreak - The line break string to be used.IllegalArgumentException - If the given indentation string is null or if the
given LineBreak is null.public AbstractIndentation(String indentationString, String lineBreakString) throws IllegalArgumentException
AbstractIndentation.
An AbstractIndentation with level 0 has no visible
effect.
indentationString - The indentation string to be used.lineBreakString - The line break string to be used.IllegalArgumentException - If the given indentation string is null or if the
given line break string is null.public String getLineBreak()
IndentationIndentation.getLineBreak in interface IndentationIndentation.public final boolean isVisible()
IndentationIndentation has any visible effect or if
every indentation string is the empty
string.isVisible in interface IndentationIndentation has any visible effect.public String get(int level) throws IllegalArgumentException
Indentation
The result is never null, even if this Indentation is
not visible.
get in interface Indentationlevel - The indentation level.IllegalArgumentException - If the given level is negative.public String get(int level, boolean includeLineBreak) throws IllegalArgumentException
Indentation
The line break characters are omitted, if this Indentation is not
visible.
The result is never null, even if this Indentation is
not visible.
get in interface Indentationlevel - The indentation level.includeLineBreak - Whether to include the line break characters.IllegalArgumentException - If the given level is negative.public void appendTo(Appendable appendable, int level) throws IllegalArgumentException, IOException
IndentationAppendableappendTo in interface Indentationappendable - 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.public void appendTo(Appendable appendable, int level, boolean includeLineBreak) throws IllegalArgumentException, IOException
IndentationAppendable.
The line break characters are omitted, if this Indentation is not
visible.
appendTo in interface Indentationappendable - 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.