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)orIssuesIoFactory.createIssuesStreamWriter(OutputStream, IssuesFormat, OutSettings)to create an instance ofIssuesStreamWriter.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:
IssuesFormat
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidadd(SnapshotData snapshot)Invoked to generate snapshot data.default voidadd(Issue issue)Invoked to generate issue data.voidadd(Issue issue, IssueAnswer answer)Invoked to generate issue and answer data.voidendDocument()Must be invoked last.voidstartDocument()Must be invoked first.
-
-
-
Method Detail
-
startDocument
void startDocument() throws IOExceptionMust 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 IOExceptionMust be invoked last.- Throws:
IOException- When an IO error occurs.
-
-