Class SuppressionCommentImpl<T extends Reportable>
java.lang.Object
net.sourceforge.pmd.lang.ast.impl.SuppressionCommentImpl<T>
- Type Parameters:
T- Type of Reportable (node, token, lambda)
- All Implemented Interfaces:
ViolationSuppressor.SuppressionCommentWrapper
@Experimental
public class SuppressionCommentImpl<T extends Reportable>
extends Object
implements ViolationSuppressor.SuppressionCommentWrapper
Simple implementation of
ViolationSuppressor.SuppressionCommentWrapper.- Experimental Status:
- See [core] Add rule to report unnecessary suppression comments/annotations #5609
- Since:
- 7.14.0
-
Constructor Summary
ConstructorsConstructorDescriptionSuppressionCommentImpl(T token, String message) Create an instance with a precomputed message.SuppressionCommentImpl(T token, Function<? super T, String> messageGetter) Create an instance where the message is computed on-demand. -
Method Summary
Modifier and TypeMethodDescriptionLocation of the comment, maybe the location of the comment token for instance.Message attached to the comment.
-
Constructor Details
-
SuppressionCommentImpl
Create an instance where the message is computed on-demand. -
SuppressionCommentImpl
Create an instance with a precomputed message.
-
-
Method Details
-
getUserMessage
Description copied from interface:ViolationSuppressor.SuppressionCommentWrapperMessage attached to the comment.- Specified by:
getUserMessagein interfaceViolationSuppressor.SuppressionCommentWrapper
-
getLocation
Description copied from interface:ViolationSuppressor.SuppressionCommentWrapperLocation of the comment, maybe the location of the comment token for instance.- Specified by:
getLocationin interfaceViolationSuppressor.SuppressionCommentWrapper
-