Class SuppressWithNearbyTextFilter.Suppression
java.lang.Object
com.puppycrawl.tools.checkstyle.filters.SuppressWithNearbyTextFilter.Suppression
- Enclosing class:
- SuppressWithNearbyTextFilter
The class which represents the suppression.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Pattern
The regexp which is used to match the event ID.private Pattern
The regexp which is used to match the event message.private final Pattern
The regexp which is used to match the event source.private final int
The first line where warnings may be suppressed.private final int
The last line where warnings may be suppressed. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Suppression
(String text, int lineNo, SuppressWithNearbyTextFilter filter) Constructs newSuppression
instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
isCheckMatch
(AuditEvent event) Checks whetherAuditEvent
source name matches the check pattern.private boolean
isIdMatch
(AuditEvent event) Checks whether theAuditEvent
module ID matches the ID pattern.private boolean
isInScopeOfSuppression
(AuditEvent event) Checks whether theAuditEvent
is in the scope of the suppression.private boolean
isMatch
(AuditEvent event) Determines whether the source of an audit event matches the text of this suppression.private boolean
isMessageMatch
(AuditEvent event) Checks whether theAuditEvent
message matches the message pattern.private static int
parseRange
(String format, String lineRange, String text) Gets range from suppress filter range format param.
-
Field Details
-
firstLine
The first line where warnings may be suppressed. -
lastLine
The last line where warnings may be suppressed. -
eventSourceRegexp
The regexp which is used to match the event source. -
eventMessageRegexp
The regexp which is used to match the event message. -
eventIdRegexp
The regexp which is used to match the event ID.
-
-
Constructor Details
-
Suppression
Constructs newSuppression
instance.- Parameters:
text
- suppression text.lineNo
- suppression line number.filter
- theSuppressWithNearbyTextFilter
with the context.- Throws:
IllegalArgumentException
- if there is an error in the filter regex syntax.
-
-
Method Details
-
parseRange
Gets range from suppress filter range format param.- Parameters:
format
- range format to parselineRange
- raw line rangetext
- text of the suppression- Returns:
- parsed range
- Throws:
IllegalArgumentException
- when unable to parse int in format
-
isMatch
Determines whether the source of an audit event matches the text of this suppression.- Parameters:
event
- theAuditEvent
to check.- Returns:
- true if the source of event matches the text of this suppression.
-
isInScopeOfSuppression
Checks whether theAuditEvent
is in the scope of the suppression.- Parameters:
event
-AuditEvent
instance.- Returns:
- true if the
AuditEvent
is in the scope of the suppression.
-
isCheckMatch
Checks whetherAuditEvent
source name matches the check pattern.- Parameters:
event
-AuditEvent
instance.- Returns:
- true if the
AuditEvent
source name matches the check pattern.
-
isIdMatch
Checks whether theAuditEvent
module ID matches the ID pattern.- Parameters:
event
-AuditEvent
instance.- Returns:
- true if the
AuditEvent
module ID matches the ID pattern.
-
isMessageMatch
Checks whether theAuditEvent
message matches the message pattern.- Parameters:
event
-AuditEvent
instance.- Returns:
- true if the
AuditEvent
message matches the message pattern.
-