Class AnsiWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable
    Direct Known Subclasses:
    ColorizedWriter

    public abstract class AnsiWriter
    extends java.io.FilterWriter
    A writer that supports customizing the output with ANSI control codes
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<WriterControlTracker> controls  
      • Fields inherited from class java.io.FilterWriter

        out
      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      AnsiWriter​(java.io.Writer writer)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void applyAll()  
      void close()  
      void registerControl​(WriterControlTracker control)  
      void registerControls​(WriterControlTracker... controls)  
      protected void resetAll()  
      void write​(char[] cbuf, int off, int len)  
      void write​(int c)  
      void write​(java.lang.String str, int off, int len)  
      • Methods inherited from class java.io.FilterWriter

        flush
      • Methods inherited from class java.io.Writer

        append, append, append, nullWriter, write, write
      • Methods inherited from class java.lang.Object

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

      • AnsiWriter

        public AnsiWriter​(java.io.Writer writer)
    • Method Detail

      • write

        public void write​(int c)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • write

        public void write​(char[] cbuf,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String str,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • applyAll

        protected final void applyAll()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • resetAll

        protected final void resetAll()
                               throws java.io.IOException
        Throws:
        java.io.IOException