org.jacoco.ant

## Class ReportTask.CheckFormatterElement

- java.lang.Object
- - org.jacoco.ant.ReportTask.CheckFormatterElement

All Implemented Interfaces:
  IViolationsOutput

Enclosing class:
  ReportTask

    public class ReportTask.CheckFormatterElement
    extends Object
    implements IViolationsOutput

Formatter element for coverage checks.

### Constructor Summary

Constructors
Constructor and Description
`CheckFormatterElement()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Rule` `createRule()` Creates and adds a new rule.
`IReportVisitor` `createVisitor()`
`void` `onViolation(ICoverageNode node, Rule rule, Limit limit, String message)` Called for every rule violation.
`void` `setFailOnViolation(boolean flag)` Sets whether the build should fail in case of a violation.
`void` `setViolationsProperty(String property)` Sets the name of a property to append the violation messages to.

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

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

### Constructor Detail

#### CheckFormatterElement

    public CheckFormatterElement()

### Method Detail

#### createRule

    public Rule createRule()

Creates and adds a new rule.

Returns:
  new rule

#### setFailOnViolation

    public void setFailOnViolation(boolean flag)

Sets whether the build should fail in case of a violation. Default is `true`.

Parameters:
  `flag` - if `true` the build fails on violation

#### setViolationsProperty

    public void setViolationsProperty(String property)

Sets the name of a property to append the violation messages to.

Parameters:
  `property` - name of a property

#### createVisitor

    public IReportVisitor createVisitor()
                                 throws IOException

Throws:
  `IOException`

#### onViolation

    public void onViolation(ICoverageNode node,
                            Rule rule,
                            Limit limit,
                            String message)

Description copied from interface: `IViolationsOutput`
Called for every rule violation.

Specified by:
  `onViolation` in interface `IViolationsOutput`
Parameters:
  `node` - node which violates a rule
  `rule` - rule which is violated
  `limit` - limit which is violated
  `message` - readable message describing this violation