Class HTMLReportFormatter

java.lang.Object
noaa.coastwatch.util.HTMLReportFormatter
All Implemented Interfaces:
ReportFormatter

public class HTMLReportFormatter extends Object implements ReportFormatter
The HTMLReportFormatter class formats report data to HTML 3.2.
Since:
3.7.1
Author:
Peter Hollemans
  • Constructor Details

    • HTMLReportFormatter

      protected HTMLReportFormatter()
  • Method Details

    • create

      public static HTMLReportFormatter create()
    • setBorderColor

      public void setBorderColor(Color border)
      Sets the HTML table border and header colour (default black).
      Parameters:
      border - the new border/header colour.
    • setSpacing

      public void setSpacing(int spacing)
      Sets the number of characters of space between table columns (default 4).
      Parameters:
      spacing - the new table spacing in characters.
    • getContent

      public String getContent()
      Gets the HTML content.
      Returns:
      the HTML content text.
    • start

      public void start()
      Description copied from interface: ReportFormatter
      Starts the report.
      Specified by:
      start in interface ReportFormatter
    • title

      public void title(String text)
      Description copied from interface: ReportFormatter
      Formats a report title.
      Specified by:
      title in interface ReportFormatter
      Parameters:
      text - the title of the report.
    • section

      public void section(String title)
      Description copied from interface: ReportFormatter
      Formats a section header.
      Specified by:
      section in interface ReportFormatter
      Parameters:
      title - the title of the section.
    • paragraph

      public void paragraph(String text)
      Description copied from interface: ReportFormatter
      Formats a paragraph.
      Specified by:
      paragraph in interface ReportFormatter
      Parameters:
      text - the text of the paragraph.
    • line

      public void line(String text)
      Description copied from interface: ReportFormatter
      Formats a single line.
      Specified by:
      line in interface ReportFormatter
      Parameters:
      text - the text of the line.
    • table

      public void table(String[] columns, List<String[]> rows)
      Description copied from interface: ReportFormatter
      Formats a table.
      Specified by:
      table in interface ReportFormatter
      Parameters:
      columns - the column names.
      rows - the list of row data values.
    • table

      public void table(String[] columns, Map<String,List<String[]>> rowMap)
      Description copied from interface: ReportFormatter
      Formats a table with multiple sections.
      Specified by:
      table in interface ReportFormatter
      Parameters:
      columns - the column names.
      rowMap - the map of section names to row data values.
    • map

      public void map(Map<String,String> map)
      Description copied from interface: ReportFormatter
      Formats a map of keys to values as a table with two columns.
      Specified by:
      map in interface ReportFormatter
      Parameters:
      map - the map of keys to values.
    • end

      public void end()
      Description copied from interface: ReportFormatter
      Ends the report.
      Specified by:
      end in interface ReportFormatter