Module de.carne
Package de.carne.io

Class ConsoleWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public final class ConsoleWriter
    extends java.io.PrintWriter
    PrintWriter implementation which supports ANSI sequences and uses the System.console() for emitting it's output.

    If System.console() yields null, System.out is used instead. In the latter case any ANSI sequence is filtered out prior to emitting the output.

    • Field Summary

      • Fields inherited from class java.io.PrintWriter

        out
      • Fields inherited from class java.io.Writer

        lock
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isAnsiEnabled()
      Checks whether this instance is capable of emitting ANSI sequences.
      • Methods inherited from class java.io.PrintWriter

        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, write, write, write
      • Methods inherited from class java.io.Writer

        nullWriter
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConsoleWriter

        public ConsoleWriter()
        Constructs a new ConsoleWriter instance.
    • Method Detail

      • isAnsiEnabled

        public boolean isAnsiEnabled()
        Checks whether this instance is capable of emitting ANSI sequences.
        Returns:
        true if ANSI sequences are emitted by this instance.