public class IndentingWriter extends Writer
| Modifier and Type | Field and Description |
|---|---|
protected int |
indentationLevel
The current indentation level, i.e.
|
protected Writer |
out
The underlying writer.
|
| Constructor and Description |
|---|
IndentingWriter(Writer out) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
decreaseIndentation() |
void |
flush() |
int |
getIndentationLevel() |
String |
getIndentationString()
Gets the string used for indentation.
|
void |
increaseIndentation() |
void |
setIndentationLevel(int indentationLevel) |
void |
setIndentationString(String indentString)
Sets the string that should be used for indentation.
|
void |
write(char[] cbuf,
int off,
int len) |
void |
writeEOL()
Writes an end-of-line character sequence and triggers the indentation for
the text written on the next line.
|
protected Writer out
protected int indentationLevel
public IndentingWriter(Writer out)
public void setIndentationString(String indentString)
indentString - The indentation string, e.g. a tab or a number of spaces.public String getIndentationString()
public int getIndentationLevel()
public void setIndentationLevel(int indentationLevel)
public void increaseIndentation()
public void decreaseIndentation()
public void writeEOL()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOExceptionCopyright © 2001-2014 Aduna. All Rights Reserved.