Class AbstractMavenReportRenderer
java.lang.Object
org.apache.maven.reporting.AbstractMavenReportRenderer
- All Implemented Interfaces:
org.apache.maven.reporting.MavenReportRenderer
public abstract class AbstractMavenReportRenderer
extends Object
implements org.apache.maven.reporting.MavenReportRenderer
An abstract class to manage report generation, with many helper methods to ease the job: you just need to implement getTitle() and renderBody().
TODO Later it may be appropriate to create something like a VelocityMavenReportRenderer that could take a velocity template and pipe that through Doxia rather than coding them up like this.
- Since:
- 2.0
- Author:
- Jason van Zyl, Emmanuel Venisse, Vincent Siveton
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.maven.doxia.sink.SinkThe current sink to use -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMavenReportRenderer(org.apache.maven.doxia.sink.Sink sink) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringcreateLinkPatternedText(String text, String href) Create a link pattern text defined by{text, url}.protected voidConvenience method to wrap section ending in the current sink.protected voidendTable()Convenience method to wrap the table ending in the current sink.abstract StringgetTitle()protected voidjavaScript(String jsCode) Convenience method to add a Javascript code in the current sink.protected voidConvenience method to wrap a link in the current sink.voidlinkPatternedText(String text) Convenience method to wrap a patterned text in the current link.protected voidConvenience method to wrap a paragraph in the current sink.protected static StringpropertiesToString(Properties props) Convenience method to display aPropertiesobject as comma separated String.voidrender()protected abstract voidRenderer the body content of the report.protected voidstartSection(String name) Convenience method to wrap section creation in the current sink.protected voidstartSection(String name, String anchor) Convenience method to wrap section creation in the current sink.protected voidConvenience method to wrap the table start in the current sink.protected voidstartTable(int[] justification, boolean grid) Convenience method to wrap the table start in the current sink.protected voidtableCaption(String caption) Convenience method to wrap a table caption in the current sink.protected voidConvenience method to wrap a table cell start in the current sink.protected voidConvenience method to wrap a table cell start in the current sink.protected voidtableHeader(String[] content) Convenience method to wrap a table header row start in the current sink.protected voidtableHeaderCell(String text) Convenience method to wrap the table header cell start in the current sink.protected voidConvenience method to wrap a table row start in the current sink.protected voidConvenience method to wrap a text in the current sink.protected voidverbatimLink(String text, String href) Convenience method to wrap a text with a given link href as verbatim style in the current sink.protected voidverbatimSource(String source) Convenience method to wrap source code as verbatim style in the current sink .protected voidverbatimText(String text) Convenience method to wrap a text as verbatim style in the current sink .
-
Field Details
-
sink
protected org.apache.maven.doxia.sink.Sink sinkThe current sink to use
-
-
Constructor Details
-
AbstractMavenReportRenderer
public AbstractMavenReportRenderer(org.apache.maven.doxia.sink.Sink sink) Default constructor.- Parameters:
sink- the sink to use.
-
-
Method Details
-
render
public void render()- Specified by:
renderin interfaceorg.apache.maven.reporting.MavenReportRenderer
-
startSection
Convenience method to wrap section creation in the current sink. An anchor will be derived from the name.- Parameters:
name- the name of this section, could be null.- See Also:
-
startSection
-
endSection
protected void endSection()Convenience method to wrap section ending in the current sink.- Throws:
IllegalStateException- if too many closing sections.- See Also:
-
startTable
protected void startTable()Convenience method to wrap the table start in the current sink.- See Also:
-
startTable
protected void startTable(int[] justification, boolean grid) Convenience method to wrap the table start in the current sink.- Parameters:
justification- the justification of table cells.grid- whether to draw a grid around cells.- Since:
- 2.1
- See Also:
-
endTable
protected void endTable()Convenience method to wrap the table ending in the current sink.- See Also:
-
tableHeaderCell
Convenience method to wrap the table header cell start in the current sink.- Parameters:
text- the text to put in this cell, could be null.- See Also:
-
tableCell
Convenience method to wrap a table cell start in the current sink.The text could be a link patterned text defined by
{text, url}- Parameters:
text- the text to put in this cell, could be null.- See Also:
-
tableCell
Convenience method to wrap a table cell start in the current sink.The text could be a link patterned text defined by
{text, url}If
asHtmlis true, add the text as Html- Parameters:
text- the text to put in this cell, could be null.asHtml-trueto add the text as Html,falseotherwise.- See Also:
-
tableRow
Convenience method to wrap a table row start in the current sink.The texts in the
contentcould be link patterned texts defined by{text, url}- Parameters:
content- an array of text to put in the cells in this row, could be null.- See Also:
-
tableHeader
Convenience method to wrap a table header row start in the current sink.- Parameters:
content- an array of text to put in the cells in this row header, could be null.- See Also:
-
tableCaption
Convenience method to wrap a table caption in the current sink.- Parameters:
caption- the caption of the table, could be null.- See Also:
-
paragraph
Convenience method to wrap a paragraph in the current sink.- Parameters:
paragraph- the paragraph to add, could be null.- See Also:
-
link
-
text
Convenience method to wrap a text in the current sink.If text is empty or has a
nullvalue, add the"-"character- Parameters:
text- a text, could be null.- See Also:
-
verbatimText
Convenience method to wrap a text as verbatim style in the current sink .- Parameters:
text- a text, could be null.- See Also:
-
verbatimLink
-
verbatimSource
Convenience method to wrap source code as verbatim style in the current sink .- Parameters:
source- a source code, could be null.- See Also:
-
javaScript
Convenience method to add a Javascript code in the current sink.- Parameters:
jsCode- a string of Javascript- See Also:
-
linkPatternedText
Convenience method to wrap a patterned text in the current link.The text variable should contained this given pattern
{text, url}to handle the link creation.- Parameters:
text- a text with link pattern defined.- See Also:
-
createLinkPatternedText
-
propertiesToString
Convenience method to display aPropertiesobject as comma separated String.- Parameters:
props- the properties to display.- Returns:
- the properties object as comma separated String
-
getTitle
- Specified by:
getTitlein interfaceorg.apache.maven.reporting.MavenReportRenderer
-
renderBody
protected abstract void renderBody()Renderer the body content of the report.
-