Package noaa.coastwatch.util
Class HTMLReportFormatter
java.lang.Object
noaa.coastwatch.util.HTMLReportFormatter
- All Implemented Interfaces:
ReportFormatter
The
HTMLReportFormatter
class formats report data to HTML 3.2.- Since:
- 3.7.1
- Author:
- Peter Hollemans
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic HTMLReportFormatter
create()
void
end()
Ends the report.Gets the HTML content.void
Formats a single line.void
Formats a map of keys to values as a table with two columns.void
Formats a paragraph.void
Formats a section header.void
setBorderColor
(Color border) Sets the HTML table border and header colour (default black).void
setSpacing
(int spacing) Sets the number of characters of space between table columns (default 4).void
start()
Starts the report.void
Formats a table.void
Formats a table with multiple sections.void
Formats a report title.
-
Constructor Details
-
HTMLReportFormatter
protected HTMLReportFormatter()
-
-
Method Details
-
create
-
setBorderColor
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
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 interfaceReportFormatter
-
title
Description copied from interface:ReportFormatter
Formats a report title.- Specified by:
title
in interfaceReportFormatter
- Parameters:
text
- the title of the report.
-
section
Description copied from interface:ReportFormatter
Formats a section header.- Specified by:
section
in interfaceReportFormatter
- Parameters:
title
- the title of the section.
-
paragraph
Description copied from interface:ReportFormatter
Formats a paragraph.- Specified by:
paragraph
in interfaceReportFormatter
- Parameters:
text
- the text of the paragraph.
-
line
Description copied from interface:ReportFormatter
Formats a single line.- Specified by:
line
in interfaceReportFormatter
- Parameters:
text
- the text of the line.
-
table
Description copied from interface:ReportFormatter
Formats a table.- Specified by:
table
in interfaceReportFormatter
- Parameters:
columns
- the column names.rows
- the list of row data values.
-
table
Description copied from interface:ReportFormatter
Formats a table with multiple sections.- Specified by:
table
in interfaceReportFormatter
- Parameters:
columns
- the column names.rowMap
- the map of section names to row data values.
-
map
Description copied from interface:ReportFormatter
Formats a map of keys to values as a table with two columns.- Specified by:
map
in interfaceReportFormatter
- Parameters:
map
- the map of keys to values.
-
end
public void end()Description copied from interface:ReportFormatter
Ends the report.- Specified by:
end
in interfaceReportFormatter
-