Class ExcludedElement
java.lang.Object
com.arc_e_tect.gradle.jacoco.model.ExcludedElement
Represents a single Java element that carries the exclusion annotation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumClassifies the kind of Java element that carries the exclusion annotation. -
Constructor Summary
ConstructorsConstructorDescriptionExcludedElement(ExcludedElement.ElementType type, String packageName, String className, String member, int lineNumber, String sourceFile) Backward-compatible constructor without justification (defaults to empty string).ExcludedElement(ExcludedElement.ElementType type, String packageName, String className, String member, int lineNumber, String sourceFile, String justification) Full constructor including justification. -
Method Summary
Modifier and TypeMethodDescriptionDisplay name used as the test-casenameattribute in XML.Returns the simple or nested class name of the declaring class.getFqcn()Fully-qualified class name.Returns the human-readable justification for the exclusion.intReturns the source line number where the exclusion annotation appears.Returns the member signature.Returns the package name of the declaring class.Returns the simple file name of the source file.getType()Returns the element type.toString()
-
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 packageclassName- simple or nested class namemember- member signature; empty for class-level exclusionslineNumber- source line number where the annotation appearssourceFile- simple file name (e.g.MyClass.java)justification- optional human-readable justification;nullis 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 packageclassName- simple or nested class namemember- member signature; empty for class-level exclusionslineNumber- source line number where the annotation appearssourceFile- simple file name (e.g.MyClass.java)
-
-
Method Details
-
getType
Returns the element type.- Returns:
- element type (class, constructor, method, or field)
-
getPackageName
Returns the package name of the declaring class.- Returns:
- package name, or an empty string for the default package
-
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
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
0when the parser could not determine a position
-
getSourceFile
Returns the simple file name of the source file.- Returns:
- simple file name, e.g.
MyClass.java
-
getJustification
Returns the human-readable justification for the exclusion.- Returns:
- the justification string, or an empty string when none was provided
-
getFqcn
Fully-qualified class name.- Returns:
- fully-qualified class name, e.g.
com.example.MyClass
-
displayName
Display name used as the test-casenameattribute in XML.- Returns:
- a bracket-prefixed label such as
"[method] myMethod()"
-
toString
-