/** * Appends the given character and marks it as ignored if it is a whitespace ({@code ch <= ' '}) * * <p>If the given character is equal to {@link Format#getNormalizedNewline()}, then the character * sequence returned by {@link Format#getLineSeparator()} is going to be appended. * * @param ch character to append */ @Override public final void appendIgnoringWhitespace(char ch) { if (ch == newLine && denormalizeLineEndings) { super.appendIgnoringWhitespace(lineSeparator1); if (lineSeparator2 != '\0') { super.appendIgnoringWhitespace(lineSeparator2); } } else { super.appendIgnoringWhitespace(ch); } }
/** * Appends the given character and marks it as ignored if it is a padding character * * <p>If the given character is equal to {@link Format#getNormalizedNewline()}, then the character * sequence returned by {@link Format#getLineSeparator()} is going to be appended. * * @param ch character to append * @param padding the padding character */ @Override public final void appendIgnoringPadding(char ch, char padding) { if (ch == newLine && denormalizeLineEndings) { super.appendIgnoringPadding(lineSeparator1, padding); if (lineSeparator2 != '\0') { super.appendIgnoringPadding(lineSeparator2, padding); } } else { super.appendIgnoringPadding(ch, padding); } }
/** * Appends the given character. * * <p>If the given character is equal to {@link Format#getNormalizedNewline()}, then the character * sequence returned by {@link Format#getLineSeparator()} is going to be appended. * * @param ch the character to append */ @Override public final void append(char ch) { if (ch == newLine && denormalizeLineEndings) { appendNewLine(); } else { super.append(ch); } }