Class ExcludedElement

java.lang.Object
com.arc_e_tect.gradle.jacoco.model.ExcludedElement

public final class ExcludedElement extends Object
Represents a single Java element that carries the exclusion annotation.
  • Constructor Details

    • ExcludedElement

      public ExcludedElement(ExcludedElement.ElementType type, String packageName, String className, String member, int lineNumber, String sourceFile, String justification)
      Full constructor including justification.
      Parameters:
      type - element type (class, constructor, method, or field)
      packageName - package of the declaring class, or empty for the default package
      className - simple or nested class name
      member - member signature; empty for class-level exclusions
      lineNumber - source line number where the annotation appears
      sourceFile - simple file name (e.g. MyClass.java)
      justification - optional human-readable justification; null is normalised to ""
    • ExcludedElement

      public ExcludedElement(ExcludedElement.ElementType type, String packageName, String className, String member, int lineNumber, String sourceFile)
      Backward-compatible constructor without justification (defaults to empty string).
      Parameters:
      type - element type (class, constructor, method, or field)
      packageName - package of the declaring class, or empty for the default package
      className - simple or nested class name
      member - member signature; empty for class-level exclusions
      lineNumber - source line number where the annotation appears
      sourceFile - simple file name (e.g. MyClass.java)
  • Method Details

    • getType

      public ExcludedElement.ElementType getType()
      Returns the element type.
      Returns:
      element type (class, constructor, method, or field)
    • getPackageName

      public String getPackageName()
      Returns the package name of the declaring class.
      Returns:
      package name, or an empty string for the default package
    • getClassName

      public String getClassName()
      Returns the simple or nested class name of the declaring class.
      Returns:
      simple class name, or a dot-separated nested name such as Outer.Inner
    • getMember

      public String getMember()
      Returns the member signature.
      Returns:
      empty string for class-level exclusions; qualified member signature for constructor, method, and field exclusions
    • getLineNumber

      public int getLineNumber()
      Returns the source line number where the exclusion annotation appears.
      Returns:
      1-based line number, or 0 when the parser could not determine a position
    • getSourceFile

      public String getSourceFile()
      Returns the simple file name of the source file.
      Returns:
      simple file name, e.g. MyClass.java
    • getJustification

      public String getJustification()
      Returns the human-readable justification for the exclusion.
      Returns:
      the justification string, or an empty string when none was provided
    • getFqcn

      public String getFqcn()
      Fully-qualified class name.
      Returns:
      fully-qualified class name, e.g. com.example.MyClass
    • displayName

      public String displayName()
      Display name used as the test-case name attribute in XML.
      Returns:
      a bracket-prefixed label such as "[method] myMethod()"
    • toString

      public String toString()
      Overrides:
      toString in class Object