# Interface JacocoViolationRule

All Superinterfaces:
  `Serializable`

public interface JacocoViolationRule extends Serializable
Defines a Jacoco violation rule.

Since:
  3.4

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getElement()`
  Gets the element for the rule as defined by org.jacoco.core.analysis.ICoverageNode.ElementType.
  `List<String>`
  `getExcludes()`
  List of elements that should be excluded from check.
  `List<String>`
  `getIncludes()`
  List of elements that should be included in check.
  `List<JacocoLimit>`
  `getLimits()`
  Gets all limits defined for this rule.
  `boolean`
  `isEnabled()`
  Indicates if the rule should be used when checking generated coverage metrics.
  `JacocoLimit`
  `limit(Action<? super JacocoLimit> configureAction)`
  Adds a limit for this rule.
  `void`
  `setElement(String element)`
  Sets element for the rule.
  `void`
  `setEnabled(boolean enabled)`
  Sets the enabled.
  `void`
  `setExcludes(List<String> excludes)`
  Sets list of elements that should be excluded from check.
  `void`
  `setIncludes(List<String> includes)`
  Sets list of elements that should be included in check.

- ## Method Details

  - ### setEnabled

    void setEnabled(boolean enabled)
    Sets the enabled.
    Since:
      3.4

  - ### isEnabled

    @Input boolean isEnabled()
    Indicates if the rule should be used when checking generated coverage metrics. Defaults to true.
    Since:
      3.4

  - ### setElement

    void setElement(String element)
    Sets element for the rule.
    Parameters:
      `element` - Element
    Since:
      3.4

  - ### getElement

    @Input String getElement()
    Gets the element for the rule as defined by org.jacoco.core.analysis.ICoverageNode.ElementType. Valid scope values are BUNDLE, PACKAGE, CLASS, SOURCEFILE and METHOD. Defaults to BUNDLE.
    Since:
      3.4

  - ### setIncludes

    void setIncludes(List<String> includes)
    Sets list of elements that should be included in check.
    Parameters:
      `includes` - Inclusions
    Since:
      3.4

  - ### getIncludes

    @Input List<String> getIncludes()
    List of elements that should be included in check. Names can use wildcards (* and ?). If left empty, all elements will be included. Defaults to [*].
    Since:
      3.4

  - ### setExcludes

    void setExcludes(List<String> excludes)
    Sets list of elements that should be excluded from check.
    Parameters:
      `excludes` - Exclusions
    Since:
      3.4

  - ### getExcludes

    @Input List<String> getExcludes()
    List of elements that should be excluded from check. Names can use wildcards (* and ?). If left empty, no elements will be excluded. Defaults to an empty list.
    Since:
      3.4

  - ### getLimits

    @Input List<JacocoLimit> getLimits()
    Gets all limits defined for this rule. Defaults to an empty list.
    Since:
      3.4

  - ### limit

    JacocoLimit limit(Action<? super JacocoLimit> configureAction)
    Adds a limit for this rule. Any number of limits can be added.
    Since:
      3.4