Class ReportWriter
java.lang.Object
org.jboss.logging.processor.apt.report.ReportWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
AsciidocReportWriter
,XmlReportWriter
Writes reports based on a
MessageInterface
. These reports could be used for documented messages from logging
or message bundle interfaces.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
(package private) static final String
(package private) final String
(package private) final MessageInterface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) String
getLogLevel
(MessageMethod method) Gets the log level from the@Message
annotation.(package private) abstract ReportType
The report type for this writer.private ResolutionDoc
getResolutionDoc
(MessageMethod messageMethod) (package private) String
getUrl
(MessageMethod messageMethod, String id) 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
Writes the footer for the report.abstract void
writeHeader
(String title) Writes the header for the report.
-
Field Details
-
DEFAULT_ID
- See Also:
-
baseUrl
-
messageInterface
-
messageIdFormat
-
-
Constructor Details
-
ReportWriter
ReportWriter(MessageInterface messageInterface)
-
-
Method Details
-
of
public static ReportWriter of(ReportType reportType, MessageInterface messageInterface, BufferedWriter writer) Creates a new report writer based on the report type.- Parameters:
reportType
- the report type to create the writer forwriter
- the used to write the contents to- Returns:
- the report writer to use
- Throws:
IllegalStateException
- if there was an error creating the report writerIllegalArgumentException
- if thereportType
is invalid
-
writeHeader
Writes the header for the report.- Parameters:
title
- the title of the header- Throws:
IOException
- if an I/O error occurs
-
writeDetail
Writes a detail line for the report.- Parameters:
messageMethod
- the method to write the details for- Throws:
IOException
- if an I/O error occurs
-
getReportType
The report type for this writer.- Returns:
- the report type
-
getLogLevel
Gets the log level from the@Message
annotation.- Parameters:
method
- the method to get the log level from- Returns:
- the log level or an empty string
-
getUrl
-
getResolutionDoc
-