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
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Writer
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
public void write(char[] cbuf, int off, int len) throws IOException
write
in class Writer
IOException
Copyright © 2001-2016 Aduna. All Rights Reserved.