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 ofViolationSuppressor.SuppressionCommentWrapper.- Experimental Status:
- Since 7.14.0. See [core] Add rule to report unnecessary suppression comments/annotations #5609
-
-
Constructor Summary
Constructors Constructor Description SuppressionCommentImpl(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReportablegetLocation()Location of the comment, maybe the location of the comment token for instance.StringgetUserMessage()Message attached to the comment.
-
-
-
Method Detail
-
getUserMessage
public String getUserMessage()
Description copied from interface:ViolationSuppressor.SuppressionCommentWrapperMessage attached to the comment.- Specified by:
getUserMessagein interfaceViolationSuppressor.SuppressionCommentWrapper
-
getLocation
public Reportable getLocation()
Description copied from interface:ViolationSuppressor.SuppressionCommentWrapperLocation of the comment, maybe the location of the comment token for instance.- Specified by:
getLocationin interfaceViolationSuppressor.SuppressionCommentWrapper
-
-