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 Modifier and Type Field Description private booleanfailOnViolationprivate java.util.List<Rule>rulesprivate booleanviolationsprivate java.lang.StringviolationsPropery
-
Constructor Summary
Constructors Constructor Description CheckFormatterElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RulecreateRule()Creates and adds a new rule.IReportVisitorcreateVisitor()(package private) voidfinish()voidonViolation(ICoverageNode node, Rule rule, Limit limit, java.lang.String message)Called for every rule violation.voidsetFailOnViolation(boolean flag)Sets whether the build should fail in case of a violation.voidsetViolationsProperty(java.lang.String property)Sets the name of a property to append the violation messages to.
-
-
-
Field Detail
-
rules
private final java.util.List<Rule> rules
-
violations
private boolean violations
-
failOnViolation
private boolean failOnViolation
-
violationsPropery
private java.lang.String violationsPropery
-
-
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 istrue.- Parameters:
flag- iftruethe build fails on violation
-
setViolationsProperty
public void setViolationsProperty(java.lang.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 java.io.IOException
- Specified by:
createVisitorin classReportTask.FormatterElement- Throws:
java.io.IOException
-
onViolation
public void onViolation(ICoverageNode node, Rule rule, Limit limit, java.lang.String message)
Description copied from interface:IViolationsOutputCalled for every rule violation.- Specified by:
onViolationin 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:
finishin classReportTask.FormatterElement
-
-