Package cdc.issues.io

Interface IssuesStreamWriter

All Superinterfaces:
AutoCloseable, Closeable, Flushable

public interface IssuesStreamWriter extends Flushable, Closeable
Interface implemented by classes that can be used to save issues at a low level.

One must use IssuesIoFactory.createIssuesStreamWriter(File, OutSettings) or IssuesIoFactory.createIssuesStreamWriter(OutputStream, IssuesFormat, OutSettings) to create an instance of IssuesStreamWriter.

WARNING: all issues should be generated together.

A typical usage would be:


 IssuesStreamWriter w = ...
 w.startDocument()
 w.add(snapshot)
 foreach issue
    w.add(issue)
 w.endDocument()
 

Note: with formats that have limitations (typically workbook sheets have a max number of rows), solutions should be provided to bypass them (using several sheets for example).

Author:
Damien Carbonne
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(SnapshotData snapshot)
    Invoked to generate snapshot data.
    default void
    add(Issue issue)
    Invoked to generate issue data.
    void
    add(Issue issue, IssueAnswer answer)
    Invoked to generate issue and answer data.
    void
    Must be invoked last.
    void
    Must be invoked first.

    Methods inherited from interface java.io.Closeable

    close

    Methods inherited from interface java.io.Flushable

    flush
  • Method Details

    • startDocument

      void startDocument() throws IOException
      Must be invoked first.
      Throws:
      IOException - When an IO error occurs.
    • add

      void add(SnapshotData snapshot) throws IOException
      Invoked to generate snapshot data.
      Parameters:
      snapshot - The snapshot data.
      Throws:
      IOException - When an IO error occurs.
    • add

      void add(Issue issue, IssueAnswer answer) throws IOException
      Invoked to generate issue and answer data.
      Parameters:
      issue - The issue.
      answer - The associated answer.
      Throws:
      IOException - When an IO error occurs.
    • add

      default void add(Issue issue) throws IOException
      Invoked to generate issue data.
      Parameters:
      issue - The issue.
      Throws:
      IOException - When an IO error occurs.
    • endDocument

      void endDocument() throws IOException
      Must be invoked last.
      Throws:
      IOException - When an IO error occurs.