public class AutoIndentWriter extends FilterWriter
FilterWriter that indents lines by processing some control characters in the character stream.
INDENT or UNINDENT may precede lines and indicate that the line and all following lines should
be (un)indented by one position.
TABULATORs may appear anywhere in lines and dictate that portions of all following lines should be
vertically aligned (see resolveTabs(List)).
| Modifier and Type | Field and Description |
|---|---|
static char |
CLEAR_TABULATORS
Special character at the beginning of a line that flushes a tabular layout.
|
static char |
INDENT
Special character at the beginning of a line that indents the following text by one position.
|
static char |
TABULATOR
Special character indicating a tabular layout of all following lines until
UNINDENT. |
static char |
UNINDENT
Special character at the beginning of a line that unindents the following text by one position.
|
out| Constructor and Description |
|---|
AutoIndentWriter(Writer out) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c) |
void |
write(String str,
int off,
int len) |
public static final char TABULATOR
UNINDENT.public static final char CLEAR_TABULATORS
public static final char INDENT
public static final char UNINDENT
public AutoIndentWriter(Writer out)
public void write(@Nullable char[] cbuf, int off, int len) throws IOException
write in class FilterWriterIOExceptionpublic void write(@Nullable String str, int off, int len) throws IOException
write in class FilterWriterIOExceptionpublic void write(int c)
throws IOException
write in class FilterWriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class FilterWriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class FilterWriterIOExceptionCopyright © 2024. All rights reserved.