Class CommentSuppressor
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.regexp.CommentSuppressor
-
- All Implemented Interfaces:
MatchSuppressor
class CommentSuppressor extends Object implements MatchSuppressor
Implementation of aMatchSuppressor
that suppresses based on whether in a comment.
-
-
Field Summary
Fields Modifier and Type Field Description private FileContents
currentContents
File contents to check for comments.
-
Constructor Summary
Constructors Constructor Description CommentSuppressor(FileContents currentContents)
Constructor for this suppressor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldSuppress(int startLineNo, int startColNo, int endLineNo, int endColNo)
Checks if the specified selection should be suppressed.
-
-
-
Field Detail
-
currentContents
private final FileContents currentContents
File contents to check for comments.
-
-
Constructor Detail
-
CommentSuppressor
CommentSuppressor(FileContents currentContents)
Constructor for this suppressor.- Parameters:
currentContents
- content of checked file.
-
-
Method Detail
-
shouldSuppress
public boolean shouldSuppress(int startLineNo, int startColNo, int endLineNo, int endColNo)
Description copied from interface:MatchSuppressor
Checks if the specified selection should be suppressed.- Specified by:
shouldSuppress
in interfaceMatchSuppressor
- Parameters:
startLineNo
- the starting line numberstartColNo
- the starting column numberendLineNo
- the ending line numberendColNo
- the ending column number- Returns:
- true if the positions intersects with a comment.
-
-