Class SuppressWithPlainTextCommentFilter.Suppression
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.filters.SuppressWithPlainTextCommentFilter.Suppression
-
- Enclosing class:
- SuppressWithPlainTextCommentFilter
private static final class SuppressWithPlainTextCommentFilter.Suppression extends Object
The class which represents the suppression.
-
-
Field Summary
Fields Modifier and Type Field Description private Pattern
eventIdRegexp
The regexp which is used to match the event ID.private Pattern
eventMessageRegexp
The regexp which is used to match the event message.private Pattern
eventSourceRegexp
The regexp which is used to match the event source.private int
lineNo
Suppression line.private SuppressWithPlainTextCommentFilter.SuppressionType
suppressionType
Suppression type.
-
Constructor Summary
Constructors Modifier Constructor Description private
Suppression(String text, int lineNo, SuppressWithPlainTextCommentFilter.SuppressionType suppressionType, SuppressWithPlainTextCommentFilter filter)
Creates new suppression instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
Indicates whether some other object is "equal to" this one.int
hashCode()
private boolean
isCheckMatch(AuditEvent event)
Checks whetherAuditEvent
source name matches the check format.private boolean
isIdMatch(AuditEvent event)
Checks whether theAuditEvent
module ID matches the ID format.private boolean
isInScopeOfSuppression(AuditEvent event)
Checks whetherAuditEvent
is in the scope of the suppression.private boolean
isMatch(AuditEvent event)
Checks whether the suppression matches the givenAuditEvent
.private boolean
isMessageMatch(AuditEvent event)
Checks whether theAuditEvent
message matches the message format.
-
-
-
Field Detail
-
eventSourceRegexp
private final Pattern eventSourceRegexp
The regexp which is used to match the event source.
-
eventMessageRegexp
private final Pattern eventMessageRegexp
The regexp which is used to match the event message.
-
eventIdRegexp
private final Pattern eventIdRegexp
The regexp which is used to match the event ID.
-
lineNo
private final int lineNo
Suppression line.
-
suppressionType
private final SuppressWithPlainTextCommentFilter.SuppressionType suppressionType
Suppression type.
-
-
Constructor Detail
-
Suppression
private Suppression(String text, int lineNo, SuppressWithPlainTextCommentFilter.SuppressionType suppressionType, SuppressWithPlainTextCommentFilter filter)
Creates new suppression instance.- Parameters:
text
- suppression text.lineNo
- suppression line number.suppressionType
- suppression type.filter
- theSuppressWithPlainTextCommentFilter
with the context.- Throws:
IllegalArgumentException
- if there is an error in the filter regex syntax.
-
-
Method Detail
-
equals
public boolean equals(Object other)
Indicates whether some other object is "equal to" this one.
-
isMatch
private boolean isMatch(AuditEvent event)
Checks whether the suppression matches the givenAuditEvent
.- Parameters:
event
-AuditEvent
instance.- Returns:
- true if the suppression matches
AuditEvent
.
-
isInScopeOfSuppression
private boolean isInScopeOfSuppression(AuditEvent event)
Checks whetherAuditEvent
is in the scope of the suppression.- Parameters:
event
-AuditEvent
instance.- Returns:
- true if
AuditEvent
is in the scope of the suppression.
-
isCheckMatch
private boolean isCheckMatch(AuditEvent event)
Checks whetherAuditEvent
source name matches the check format.- Parameters:
event
-AuditEvent
instance.- Returns:
- true if the
AuditEvent
source name matches the check format.
-
isIdMatch
private boolean isIdMatch(AuditEvent event)
Checks whether theAuditEvent
module ID matches the ID format.- Parameters:
event
-AuditEvent
instance.- Returns:
- true if the
AuditEvent
module ID matches the ID format.
-
isMessageMatch
private boolean isMessageMatch(AuditEvent event)
Checks whether theAuditEvent
message matches the message format.- Parameters:
event
-AuditEvent
instance.- Returns:
- true if the
AuditEvent
message matches the message format.
-
-