/** * Constructs a filter which replaces tab characters ({@code '\t'}) * by spaces. Tab widths default to 8 characters. * * @param out A writer object to provide the underlying stream. */ public ExpandedTabWriter(final Writer out) { this(new LineAppender(out)); }
/** * Constructs a {@code LineWriter} object that will use the specified line separator. * * @param out A writer object to provide the underlying stream. * @param lineSeparator String to use as line separator. */ public LineWriter(final Writer out, final String lineSeparator) { this(new LineAppender(out)); formatter.setLineSeparator(lineSeparator); }
/** * Creates and configure the {@link LineAppender} to test. */ @Before @Override public void createLineAppender() { appender = new LineAppender(new LineAppender(appender, "\r", false), 10, false); }
/** * Returns the exception trace as a string. This method get the stack trace using the * {@link Throwable#printStackTrace(PrintWriter)} method, then replaces the tabulation * characters by 4 white spaces. * * @param exception The exception to format. * @return A string representation of the given exception. */ public static String formatStackTrace(final Throwable exception) { final StringWriter writer = new StringWriter(); exception.printStackTrace(new PrintWriter(writer)); final StringBuilder buffer = new StringBuilder(); final LineAppender formatter = new LineAppender(buffer); formatter.setTabulationWidth(TAB_WIDTH); try { formatter.append(writer.toString()); } catch (IOException e) { throw new AssertionError(e); } return buffer.toString(); }
/** * Creates and configure the {@link LineAppender} to test. */ @Before @Override public void createLineAppender() { appender = new LineAppender(appender, null, true); }
/** * Creates and configure the {@link LineAppender} to test. */ @Before @Override public void createLineAppender() { appender = new LineAppender(appender, 10, false); }
/** * Creates and configure the {@link LineAppender} to test. */ @Before public void createLineAppender() { appender = new LineAppender(appender, " ", false); }
? new LineAppender(out, Integer.MAX_VALUE, true) : out; switch (cell.alignment) { default: {
? new LineAppender(out, Integer.MAX_VALUE, true) : out; switch (cell.alignment) { default: {
writer = new LineAppender(str, System.lineSeparator(), true); buffer = str.getBuffer().append(header); printer = new PrintWriter(IO.asWriter(writer));
writer = new LineAppender(str, System.lineSeparator(), true); buffer = str.getBuffer().append(header); printer = new PrintWriter(IO.asWriter(writer));
outHeader = new TableAppender(new LineAppender(out), " "); outHeader.setMultiLinesCells(true); printHeader(Vocabulary.Keys.Source); printNameAndIdentifier(operation.getSourceCRS(), false);