Class AnsiHtmlOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public class AnsiHtmlOutputStream
    extends AnsiOutputStream
    Filters an output stream of ANSI escape sequences and emits appropriate HTML elements instead. Overlapping ANSI attribute combinations are handled by rewinding the HTML element stack. How the HTML is actually emitted depends on the specified AnsiAttributeElement.Emitter. For Jenkins, the Emitter creates ConsoleNotes as part of the stream, but for other software or testing the HTML may be emitted otherwise. The only thing that ties this class to Jenkins is the rather unfortunate ConsoleNote preamble/postamble handling via state machine. Simply remove this if you plan to use this class somewhere else.