public static class StaticUtils.IndentedWriter extends Writer
| Constructor and Description |
|---|
StaticUtils.IndentedWriter(Writer writer,
int initialIndent)
Constructs a new IndentedWriter with the given inital indent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
void |
indent()
Increase the indentation level for subsequent writes.
|
void |
outdent()
Decrease the indentation level for subsequent writes.
|
String |
toString() |
void |
write(char[] characters,
int offset,
int length)
Write the given characters, inserting indents as necessary.
|
public StaticUtils.IndentedWriter(Writer writer, int initialIndent)
Note the initialIndent and carriage returns are applied to every line, including the first and last. If this is undesirable, clients can use String.trim().
writer - the writer to delegate all writes toinitialIndent - the initialIndent that will be applied to every linepublic void indent()
public void outdent()
public void write(char[] characters,
int offset,
int length)
throws IOException
write in class WriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionCopyright © 2015. All Rights Reserved.