Interface StyledOutput

All Superinterfaces:
AutoCloseable, Closeable

public interface StyledOutput extends Closeable
Class represents a consumer of styled text segments for the purposes of exporting, copying, or saving to an output stream.
Since:
24
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Consumes the next styled segment.
    void
    Flushes this output stream.
    Creates an instance of a plain text StyledOutput with the platform line ending.
    Creates an instance of a plain text StyledOutput with the specified line ending characters.

    Methods declared in interface Closeable

    close
  • Method Details

    • consume

      void consume(StyledSegment segment) throws IOException
      Consumes the next styled segment.
      Parameters:
      segment - the segment to output
      Throws:
      IOException - when an I/O error occurs
    • flush

      void flush() throws IOException
      Flushes this output stream.
      Throws:
      IOException - when an I/O error occurs
    • forPlainText

      static StyledOutput forPlainText()
      Creates an instance of a plain text StyledOutput with the platform line ending.
      Returns:
      the instance of a plain text StyledOutput
    • forPlainText

      static StyledOutput forPlainText(LineEnding lineEnding)
      Creates an instance of a plain text StyledOutput with the specified line ending characters.
      Parameters:
      lineEnding - the line ending characters
      Returns:
      the instance of a plain text StyledOutput
      Since:
      26