Class ReportPage
- java.lang.Object
-
- org.jacoco.report.internal.html.page.ReportPage
-
- All Implemented Interfaces:
ILinkable
- Direct Known Subclasses:
NodePage,SessionsPage
public abstract class ReportPage extends java.lang.Object implements ILinkable
Base class for HTML page generators. It renders the page skeleton with the breadcrumb, the title and the footer. Every report page is part of a hierarchy and has a parent page (except the root page).
-
-
Field Summary
Fields Modifier and Type Field Description protected IHTMLReportContextcontextcontext for this reportprotected ReportOutputFolderfolderoutput folder for this nodeprivate ReportPageparent
-
Constructor Summary
Constructors Modifier Constructor Description protectedReportPage(ReportPage parent, ReportOutputFolder folder, IHTMLReportContext context)Creates a new report page.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private voidbody(HTMLElement body)private voidbreadcrumb(HTMLElement div, ReportOutputFolder base)private static voidbreadcrumbParent(ReportPage page, HTMLElement div, ReportOutputFolder base)protected abstract voidcontent(HTMLElement body)Creates the actual content of the page.private voidfooter(HTMLElement body)protected abstract java.lang.StringgetFileName()Specifies the local file name of this page.java.lang.StringgetLink(ReportOutputFolder base)Returns a relative link to the item that works from the given base folder.protected java.lang.StringgetOnload()Returns the onload handler for this page.protected voidhead(HTMLElement head)Creates the elements within the head element.protected voidinfoLinks(HTMLElement span)Inserts additional links on the top right corner.protected booleanisRootPage()Checks whether this is the root page of the report.voidrender()Renders this page's content and optionally additional pages.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jacoco.report.internal.html.ILinkable
getLinkLabel, getLinkStyle
-
-
-
-
Field Detail
-
parent
private final ReportPage parent
-
folder
protected final ReportOutputFolder folder
output folder for this node
-
context
protected final IHTMLReportContext context
context for this report
-
-
Constructor Detail
-
ReportPage
protected ReportPage(ReportPage parent, ReportOutputFolder folder, IHTMLReportContext context)
Creates a new report page.- Parameters:
parent- optional hierarchical parentfolder- base folder to create this report incontext- settings context
-
-
Method Detail
-
isRootPage
protected final boolean isRootPage()
Checks whether this is the root page of the report.- Returns:
trueif this is the root page
-
render
public void render() throws java.io.IOExceptionRenders this page's content and optionally additional pages. This method must be called at most once.- Throws:
java.io.IOException- if the page can't be written
-
head
protected void head(HTMLElement head) throws java.io.IOException
Creates the elements within the head element.- Parameters:
head- head tag of the page- Throws:
java.io.IOException- in case of IO problems with the report writer
-
body
private void body(HTMLElement body) throws java.io.IOException
- Throws:
java.io.IOException
-
getOnload
protected java.lang.String getOnload()
Returns the onload handler for this page.- Returns:
- handler or
null
-
infoLinks
protected void infoLinks(HTMLElement span) throws java.io.IOException
Inserts additional links on the top right corner.- Parameters:
span- parent element- Throws:
java.io.IOException- in case of IO problems with the report writer
-
breadcrumb
private void breadcrumb(HTMLElement div, ReportOutputFolder base) throws java.io.IOException
- Throws:
java.io.IOException
-
breadcrumbParent
private static void breadcrumbParent(ReportPage page, HTMLElement div, ReportOutputFolder base) throws java.io.IOException
- Throws:
java.io.IOException
-
footer
private void footer(HTMLElement body) throws java.io.IOException
- Throws:
java.io.IOException
-
getFileName
protected abstract java.lang.String getFileName()
Specifies the local file name of this page.- Returns:
- local file name
-
content
protected abstract void content(HTMLElement body) throws java.io.IOException
Creates the actual content of the page.- Parameters:
body- body tag of the page- Throws:
java.io.IOException- in case of IO problems with the report writer
-
getLink
public final java.lang.String getLink(ReportOutputFolder base)
Description copied from interface:ILinkableReturns a relative link to the item that works from the given base folder.
-
-