org.jacoco.report.internal.html

## Class HTMLElement

- java.lang.Object
- - org.jacoco.report.internal.xml.XMLElement
  - - org.jacoco.report.internal.html.HTMLElement

    public class HTMLElement
    extends XMLElement

A `XMLElement` with utility methods to create XHTML documents. It provides methods of HTML tags to avoid magic strings in the generators.

### Field Summary

### Fields inherited from class org.jacoco.report.internal.xml.XMLElement

`writer`

### Constructor Summary

Constructors
`protected` `HTMLElement(Writer writer, String name)` Creates a new element for a HTML document.

### Method Summary

All Methods Instance Methods Concrete Methods
`HTMLElement` `a(ILinkable linkable, ReportOutputFolder base)` Creates a link to the given `ILinkable`.
`HTMLElement` `a(String hrefattr)` Creates a 'a' element.
`HTMLElement` `a(String hrefattr, String classattr)` Creates a 'a' element.
`HTMLElement` `code()` Creates a 'code' element.
`HTMLElement` `div(String classattr)` Creates a 'div' element.
`HTMLElement` `element(String name)` Creates a new child element for this element,
`HTMLElement` `h1()` Creates a 'h1' element.
`void` `img(String srcattr, int widthattr, int heightattr, String titleattr)` Creates a 'img' element.
`HTMLElement` `link(String relattr, String hrefattr, String typeattr)` Creates a 'link' element.
`HTMLElement` `meta(String httpequivattr, String contentattr)` Creates a 'meta' element.
`HTMLElement` `p()` Creates a 'p' element.
`HTMLElement` `pre(String classattr)` Creates a 'pre' element.
`void` `script(String typeattr, String srcattr)` Creates a 'script' element.
`HTMLElement` `span()` Creates a 'span' element.
`HTMLElement` `span(String classattr)` Creates a 'span' element.
`HTMLElement` `span(String classattr, String idattr)` Creates a 'span' element.
`HTMLElement` `table(String classattr)` Creates a 'table' element.
`HTMLElement` `tbody()` Creates a 'tbody' element.
`HTMLElement` `td()` Creates a 'td' element.
`HTMLElement` `td(String classattr)` Creates a 'td' element.
`HTMLElement` `tfoot()` Creates a 'tfoot' element.
`HTMLElement` `thead()` Creates a 'thead' element.
`HTMLElement` `title()` Creates a 'title' element.
`HTMLElement` `tr()` Creates a 'tr' element.

### Methods inherited from class org.jacoco.report.internal.xml.XMLElement

`addChildElement, attr, attr, attr, beginOpenTag, close, text`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HTMLElement

    protected HTMLElement(Writer writer,
                          String name)

Creates a new element for a HTML document.

Parameters:
  `writer` - all output will be written directly to this
  `name` - element name

### Method Detail

#### element

    public HTMLElement element(String name)
                        throws IOException

Description copied from class: `XMLElement`
Creates a new child element for this element,

Overrides:
  `element` in class `XMLElement`
Parameters:
  `name` - name of the child element
Returns:
  child element instance
Throws:
  `IOException` - in case of problems with the writer

#### meta

    public HTMLElement meta(String httpequivattr,
                            String contentattr)
                     throws IOException

Creates a 'meta' element.

Parameters:
  `httpequivattr` - value of the http-equiv attribute
  `contentattr` - value for the content attribute
Returns:
  'meta' element
Throws:
  `IOException` - in case of problems with the writer

#### link

    public HTMLElement link(String relattr,
                            String hrefattr,
                            String typeattr)
                     throws IOException

Creates a 'link' element.

Parameters:
  `relattr` - value of the rel attribute
  `hrefattr` - value for the href attribute
  `typeattr` - value for the type attribute
Returns:
  'link' element
Throws:
  `IOException` - in case of problems with the writer

#### title

    public HTMLElement title()
                      throws IOException

Creates a 'title' element.

Returns:
  'title' element
Throws:
  `IOException` - in case of problems with the writer

#### h1

    public HTMLElement h1()
                   throws IOException

Creates a 'h1' element.

Returns:
  'h1' element
Throws:
  `IOException` - in case of problems with the writer

#### p

    public HTMLElement p()
                  throws IOException

Creates a 'p' element.

Returns:
  'p' element
Throws:
  `IOException` - in case of problems with the writer

#### span

    public HTMLElement span()
                     throws IOException

Creates a 'span' element.

Returns:
  'span' element
Throws:
  `IOException` - in case of problems with the writer

#### span

    public HTMLElement span(String classattr)
                     throws IOException

Creates a 'span' element.

Parameters:
  `classattr` - value of the class attribute
Returns:
  'span' element
Throws:
  `IOException` - in case of problems with the writer

#### span

    public HTMLElement span(String classattr,
                            String idattr)
                     throws IOException

Creates a 'span' element.

Parameters:
  `classattr` - value of the class attribute
  `idattr` - value of the id attribute
Returns:
  'span' element
Throws:
  `IOException` - in case of problems with the writer

#### div

    public HTMLElement div(String classattr)
                    throws IOException

Creates a 'div' element.

Parameters:
  `classattr` - value of the class attribute
Returns:
  'div' element
Throws:
  `IOException` - in case of problems with the writer

#### code

    public HTMLElement code()
                     throws IOException

Creates a 'code' element.

Returns:
  'code' element
Throws:
  `IOException` - in case of problems with the writer

#### pre

    public HTMLElement pre(String classattr)
                    throws IOException

Creates a 'pre' element.

Parameters:
  `classattr` - value of the class attribute
Returns:
  'pre' element
Throws:
  `IOException` - in case of problems with the writer

#### a

    public HTMLElement a(String hrefattr)
                  throws IOException

Creates a 'a' element.

Parameters:
  `hrefattr` - value of the href attribute
Returns:
  'a' element
Throws:
  `IOException` - in case of problems with the writer

#### a

    public HTMLElement a(String hrefattr,
                         String classattr)
                  throws IOException

Creates a 'a' element.

Parameters:
  `hrefattr` - value of the href attribute
  `classattr` - value of the class attribute
Returns:
  'a' element
Throws:
  `IOException` - in case of problems with the writer

#### a

    public HTMLElement a(ILinkable linkable,
                         ReportOutputFolder base)
                  throws IOException

Creates a link to the given `ILinkable`.

Parameters:
  `linkable` - object to link to
  `base` - base folder where the link should be placed
Returns:
  'a' element or 'span' element, if the link target does not exist
Throws:
  `IOException` - in case of problems with the writer

#### table

    public HTMLElement table(String classattr)
                      throws IOException

Creates a 'table' element.

Parameters:
  `classattr` - value of the class attribute
Returns:
  'table' element
Throws:
  `IOException` - in case of problems with the writer

#### thead

    public HTMLElement thead()
                      throws IOException

Creates a 'thead' element.

Returns:
  'thead' element
Throws:
  `IOException` - in case of problems with the writer

#### tfoot

    public HTMLElement tfoot()
                      throws IOException

Creates a 'tfoot' element.

Returns:
  'tfoot' element
Throws:
  `IOException` - in case of problems with the writer

#### tbody

    public HTMLElement tbody()
                      throws IOException

Creates a 'tbody' element.

Returns:
  'tbody' element
Throws:
  `IOException` - in case of problems with the writer

#### tr

    public HTMLElement tr()
                   throws IOException

Creates a 'tr' element.

Returns:
  'tr' element
Throws:
  `IOException` - in case of problems with the writer

#### td

    public HTMLElement td()
                   throws IOException

Creates a 'td' element.

Returns:
  'td' element
Throws:
  `IOException` - in case of problems with the writer

#### td

    public HTMLElement td(String classattr)
                   throws IOException

Creates a 'td' element.

Parameters:
  `classattr` - value of the class attribute
Returns:
  'td' element
Throws:
  `IOException` - in case of problems with the writer

#### img

    public void img(String srcattr,
                    int widthattr,
                    int heightattr,
                    String titleattr)
             throws IOException

Creates a 'img' element.

Parameters:
  `srcattr` - value of the src attribute
  `widthattr` - value of the width attribute
  `heightattr` - value of the height attribute
  `titleattr` - value of the title and alt attribute
Throws:
  `IOException` - in case of problems with the writer

#### script

    public void script(String typeattr,
                       String srcattr)
                throws IOException

Creates a 'script' element.

Parameters:
  `typeattr` - value of the type attribute
  `srcattr` - value of the src attribute
Throws:
  `IOException` - in case of problems with the writer