Closeable
, AutoCloseable
public abstract class ReportWriter extends Object implements Closeable
MessageInterface
. These reports could be used for documented messages from logging
or message bundle interfaces.Modifier and Type | Method | Description |
---|---|---|
static ReportWriter |
of(ReportType reportType,
MessageInterface messageInterface,
BufferedWriter writer) |
Creates a new report writer based on the report type.
|
abstract void |
writeDetail(MessageMethod messageMethod) |
Writes a detail line for the report.
|
abstract void |
writeFooter() |
Writes the footer for the report.
|
abstract void |
writeHeader(String title) |
Writes the header for the report.
|
public static ReportWriter of(ReportType reportType, MessageInterface messageInterface, BufferedWriter writer)
reportType
- the report type to create the writer forwriter
- the used to write the contents toIllegalStateException
- if there was an error creating the report writerIllegalArgumentException
- if the reportType
is invalidpublic abstract void writeHeader(String title) throws IOException
title
- the title of the headerIOException
- if an I/O error occurspublic abstract void writeDetail(MessageMethod messageMethod) throws IOException
messageMethod
- the method to write the details forIOException
- if an I/O error occurspublic abstract void writeFooter() throws IOException
IOException
- if an I/O error occursCopyright © 2018. All rights reserved.