org.fusesource.jansi
Class AnsiConsole

java.lang.Object
  extended by org.fusesource.jansi.AnsiConsole

public class AnsiConsole
extends java.lang.Object

Provides consistent access to an ANSI aware console PrintStream.

Since:
1.0

Field Summary
static java.io.PrintStream err
           
static java.io.PrintStream out
           
static java.io.PrintStream system_err
           
static java.io.PrintStream system_out
           
 
Constructor Summary
AnsiConsole()
           
 
Method Summary
static java.io.PrintStream err()
          If the standard out natively supports ANSI escape codes, then this just returns System.err, otherwise it will provide an ANSI aware PrintStream which strips out the ANSI escape sequences or which implement the escape sequences.
static java.io.PrintStream out()
          If the standard out natively supports ANSI escape codes, then this just returns System.out, otherwise it will provide an ANSI aware PrintStream which strips out the ANSI escape sequences or which implement the escape sequences.
static void systemInstall()
          Install Console.out to System.out.
static void systemUninstall()
          undo a previous systemInstall().
static java.io.OutputStream wrapOutputStream(java.io.OutputStream stream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

system_out

public static final java.io.PrintStream system_out

out

public static final java.io.PrintStream out

system_err

public static final java.io.PrintStream system_err

err

public static final java.io.PrintStream err
Constructor Detail

AnsiConsole

public AnsiConsole()
Method Detail

wrapOutputStream

public static java.io.OutputStream wrapOutputStream(java.io.OutputStream stream)

out

public static java.io.PrintStream out()
If the standard out natively supports ANSI escape codes, then this just returns System.out, otherwise it will provide an ANSI aware PrintStream which strips out the ANSI escape sequences or which implement the escape sequences.

Returns:
a PrintStream which is ANSI aware.

err

public static java.io.PrintStream err()
If the standard out natively supports ANSI escape codes, then this just returns System.err, otherwise it will provide an ANSI aware PrintStream which strips out the ANSI escape sequences or which implement the escape sequences.

Returns:
a PrintStream which is ANSI aware.

systemInstall

public static void systemInstall()
Install Console.out to System.out.


systemUninstall

public static void systemUninstall()
undo a previous systemInstall(). If systemInstall() was called multiple times, it systemUninstall() must call the same number of times before it is actually uninstalled.