public class IndentingWriter extends BufferedWriter
| Constructor and Description |
|---|
IndentingWriter(Writer out)
Create a new IndentingWriter that writes indented text to the
given Writer.
|
IndentingWriter(Writer out,
int step)
Create a new IndentingWriter that writes indented text to the
given Writer and uses the supplied indent step.
|
IndentingWriter(Writer out,
int step,
int tabSize)
Create a new IndentingWriter that writes indented text to the
given Writer and uses the supplied indent step and tab size.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkWrite()
Check if an indent needs to be written before writing the next
character.
|
protected void |
indentIn()
Increase the current indent by the indent step.
|
protected void |
indentOut()
Decrease the current indent by the indent step.
|
void |
newLine()
Write a line separator.
|
void |
p(Object o)
Write Object.
|
void |
p(String s)
Write string.
|
void |
pI()
Indent in.
|
void |
pln()
End current line.
|
void |
pln(Object o)
Write Object; end current line.
|
void |
pln(String s)
Write string; end current line.
|
void |
plnI(Object o)
Write Object; end current line; indent in.
|
void |
plnI(String s)
Write string; end current line; indent in.
|
void |
pO()
Indent out.
|
void |
pO(Object o)
Indent out; write Object.
|
void |
pO(String s)
Indent out; write string.
|
void |
pOln(Object o)
Indent out; write Object; end current line.
|
void |
pOln(String s)
Indent out; write string; end current line.
|
void |
pOlnI(Object o)
Indent out; write Object; end current line; indent in.
|
void |
pOlnI(String s)
Indent out; write string; end current line; indent in.
|
void |
write(char[] cbuf,
int off,
int len)
Write a portion of an array of characters.
|
void |
write(int c)
Write a single character.
|
void |
write(String s,
int off,
int len)
Write a portion of a String.
|
close, flushpublic IndentingWriter(Writer out)
public IndentingWriter(Writer out, int step)
public IndentingWriter(Writer out, int step, int tabSize)
public void write(int c)
throws IOException
write in class BufferedWriterIOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws IOException
write in class BufferedWriterIOExceptionpublic void write(String s, int off, int len) throws IOException
write in class BufferedWriterIOExceptionpublic void newLine()
throws IOException
newLine in class BufferedWriterIOExceptionprotected void checkWrite()
throws IOException
IOExceptionprotected void indentIn()
protected void indentOut()
public void pI()
public void pO()
public void p(String s) throws IOException
IOExceptionpublic void pln()
throws IOException
IOExceptionpublic void pln(String s) throws IOException
IOExceptionpublic void plnI(String s) throws IOException
IOExceptionpublic void pO(String s) throws IOException
IOExceptionpublic void pOln(String s) throws IOException
IOExceptionpublic void pOlnI(String s) throws IOException
IOExceptionpublic void p(Object o) throws IOException
IOExceptionpublic void pln(Object o) throws IOException
IOExceptionpublic void plnI(Object o) throws IOException
IOExceptionpublic void pO(Object o) throws IOException
IOExceptionpublic void pOln(Object o) throws IOException
IOExceptionpublic void pOlnI(Object o) throws IOException
IOExceptionCopyright © 2017. All Rights Reserved.