Class ReportWriter

java.lang.Object
org.jboss.logging.processor.apt.report.ReportWriter
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
AsciidocReportWriter, XmlReportWriter

public abstract class ReportWriter extends Object implements Closeable
Writes reports based on a MessageInterface. These reports could be used for documented messages from logging or message bundle interfaces.
  • Field Details

  • Constructor Details

  • 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 for
      writer - the used to write the contents to
      Returns:
      the report writer to use
      Throws:
      IllegalStateException - if there was an error creating the report writer
      IllegalArgumentException - if the reportType is invalid
    • writeHeader

      public abstract void writeHeader(String title) throws IOException
      Writes the header for the report.
      Parameters:
      title - the title of the header
      Throws:
      IOException - if an I/O error occurs
    • writeDetail

      public abstract void writeDetail(MessageMethod messageMethod) throws IOException
      Writes a detail line for the report.
      Parameters:
      messageMethod - the method to write the details for
      Throws:
      IOException - if an I/O error occurs
    • writeFooter

      public abstract void writeFooter() throws IOException
      Writes the footer for the report.
      Throws:
      IOException - if an I/O error occurs
    • getReportType

      abstract ReportType getReportType()
      The report type for this writer.
      Returns:
      the report type
    • getLogLevel

      String getLogLevel(MessageMethod method)
      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

      String getUrl(MessageMethod messageMethod, String id)
    • getResolutionDoc

      private ResolutionDoc getResolutionDoc(MessageMethod messageMethod)