An {@link Appendable} which can apply different kinds of reformatting that depend on the
End Of Line (EOL) occurrences. Available reformatting include inserting a a margin before each line, wrapping to a maximal line length and replacing tabulations or EOL characters. The actual work to be done can be enabled by invoking one or many of the following methods:
- {@link #setMaximalLineLength(int)} for wrapping the lines to some maximal line length,typically 80 Unicode characters (code points).
- {@link #setTabulationExpanded(boolean)} for replacing tabulation characters by spaces.
- {@link #setLineSeparator(String)} for replacing all occurrences of{@linkplain Characters#isLineOrParagraphSeparator(int) line separators} by the given string.
In addition this class removes trailing {@linkplain Character#isWhitespace(int) whitespaces}before end of lines. {@section How line lengths are calculated}Line length are measured in unit of Unicode
code points. This is usually the same than the number of {@code char} primitive values, but not always. Combining characters are notyet recognized by this class, but future versions may improve on that.
For proper line length calculation in presence of tabulation characters ( {@code '\t'}), this class needs to known the tabulation width. The default value is 8, but this can be changed by a call to {@link #setTabulationWidth(int)}. Note that invoking that method affects only line length calculation; it does not replace tabulations by spaces. For tabulation expansion, see {@link #setTabulationExpanded(boolean)}.
@author Martin Desruisseaux (Geomatys)
@since 0.3 (derived from geotk-3.00)
@version 0.3
@module