|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
oracle.idm.io.IndentPrintStream
public class IndentPrintStream
IndentPrintStream is a convenience class for indented printing. It extends the PrintStream, and simplifies printing of indented information, such as XML tags. You can construct the IndentPrintStream from any OutputStream. If OutputStream used to construct the IndentPrintStream is already an instance of IndentPrintStream, both will share the same Indentater.
Here is an example of how to use IndentPrintStream:
IndentPrintStream out = new IndentPrintStream(System.out); out.iprintln(...); out.increase(); foo.print(out); // foo will print at increased indentation level out.decrease(); out.iprintln(...);
Field Summary |
---|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
IndentPrintStream(java.io.OutputStream out) Constructor for indent print stream from output stream. |
|
IndentPrintStream(java.io.OutputStream out, boolean autoFlush) Constructor for indent print stream from output stream, given auto flush mode. |
|
IndentPrintStream(java.io.OutputStream out, boolean autoFlush, java.lang.String encoding) Constructor for indent print stream from output stream, given auto flush mode and encoding. |
Method Summary | |
---|---|
void |
decrease() This method decreases indentation level. |
Indenter |
getIndenter() Getter for the indenter of this indent print stream. |
static IndentPrintStream |
getIndentPrintStream(java.io.OutputStream out) Factory method for indent print streams. |
void |
increase() This method increases indentation level. |
void |
indent() This method prints the indentation. |
void |
iprint(boolean b) Indents and prints a boolean. |
void |
iprint(char c) Indents and prints a char. |
void |
iprint(char[] s) Indents and prints a char[]. |
void |
iprint(double d) Indents and prints a double. |
void |
iprint(float f) Indents and prints a float. |
void |
iprint(int i) Indents and prints an int. |
void |
iprint(long l) Indents and prints a long. |
void |
iprint(java.lang.Object o) Indents and prints an object. |
void |
iprint(java.lang.String s) Indents and prints a string. |
void |
iprintln() Indents and terminates the line. |
void |
iprintln(boolean b) Indents, prints a boolean, and terminates the line. |
void |
iprintln(char c) Indents, prints a char, and terminates the line. |
void |
iprintln(char[] s) Indents, prints a char[], and terminates the line. |
void |
iprintln(double d) Indents, prints a double, and terminates the line. |
void |
iprintln(float f) Indents, prints a float, and terminates the line. |
void |
iprintln(int i) Indents, prints an int, and terminates the line. |
void |
iprintln(long l) Indents, prints a long, and terminates the line. |
void |
iprintln(java.lang.Object o) Indents, prints an object, and terminates the line. |
void |
iprintln(java.lang.String s) Indents, prints a string, and terminates the line. |
void |
setIndenter(Indenter indenter) Setter for the indenter of this indent print stream. |
Methods inherited from class java.io.PrintStream |
---|
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write |
Methods inherited from class java.io.FilterOutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndentPrintStream(java.io.OutputStream out)
public IndentPrintStream(java.io.OutputStream out, boolean autoFlush)
public IndentPrintStream(java.io.OutputStream out, boolean autoFlush, java.lang.String encoding) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
Method Detail |
---|
public static IndentPrintStream getIndentPrintStream(java.io.OutputStream out)
public Indenter getIndenter()
getIndenter
in interface Indentable
public void setIndenter(Indenter indenter)
setIndenter
in interface Indentable
public void increase()
increase
in interface Indentable
public void decrease()
decrease
in interface Indentable
public void indent()
indent
in interface Indentable
public void iprint(boolean b)
public void iprint(char c)
public void iprint(int i)
public void iprint(long l)
public void iprint(float f)
public void iprint(double d)
public void iprint(char[] s)
public void iprint(java.lang.String s)
public void iprint(java.lang.Object o)
public void iprintln()
public void iprintln(boolean b)
public void iprintln(char c)
public void iprintln(int i)
public void iprintln(long l)
public void iprintln(float f)
public void iprintln(double d)
public void iprintln(char[] s)
public void iprintln(java.lang.String s)
public void iprintln(java.lang.Object o)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |