Package org.jacoco.ant
Class ReportTask.CheckFormatterElement
java.lang.Object
org.jacoco.ant.ReportTask.FormatterElement
org.jacoco.ant.ReportTask.CheckFormatterElement
- All Implemented Interfaces:
IViolationsOutput
- Enclosing class:
- ReportTask
public class ReportTask.CheckFormatterElement
extends ReportTask.FormatterElement
implements IViolationsOutput
Formatter element for coverage checks.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates and adds a new rule.(package private) void
finish()
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.
-
Field Details
-
rules
-
violations
private boolean violations -
failOnViolation
private boolean failOnViolation -
violationsPropery
-
-
Constructor Details
-
CheckFormatterElement
public CheckFormatterElement()
-
-
Method Details
-
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 istrue
.- Parameters:
flag
- iftrue
the build fails on violation
-
setViolationsProperty
Sets the name of a property to append the violation messages to.- Parameters:
property
- name of a property
-
createVisitor
- Specified by:
createVisitor
in classReportTask.FormatterElement
- Throws:
IOException
-
onViolation
Description copied from interface:IViolationsOutput
Called for every rule violation.- Specified by:
onViolation
in interfaceIViolationsOutput
- Parameters:
node
- node which violates a rulerule
- rule which is violatedlimit
- limit which is violatedmessage
- readable message describing this violation
-
finish
void finish()- Overrides:
finish
in classReportTask.FormatterElement
-