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 PatternThe regexp which is used to match the event ID.private PatternThe regexp which is used to match the event message.private final PatternThe regexp which is used to match the event source.private final intThe first line where warnings may be suppressed.private final intThe last line where warnings may be suppressed. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSuppression(String text, int lineNo, SuppressWithNearbyTextFilter filter) Constructs newSuppressioninstance. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanisCheckMatch(AuditEvent event) Checks whetherAuditEventsource name matches the check pattern.private booleanisIdMatch(AuditEvent event) Checks whether theAuditEventmodule ID matches the ID pattern.private booleanisInScopeOfSuppression(AuditEvent event) Checks whether theAuditEventis in the scope of the suppression.private booleanisMatch(AuditEvent event) Determines whether the source of an audit event matches the text of this suppression.private booleanisMessageMatch(AuditEvent event) Checks whether theAuditEventmessage matches the message pattern.private static intparseRange(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 newSuppressioninstance.- Parameters:
text- suppression text.lineNo- suppression line number.filter- theSuppressWithNearbyTextFilterwith 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- theAuditEventto check.- Returns:
- true if the source of event matches the text of this suppression.
-
isInScopeOfSuppression
Checks whether theAuditEventis in the scope of the suppression.- Parameters:
event-AuditEventinstance.- Returns:
- true if the
AuditEventis in the scope of the suppression.
-
isCheckMatch
Checks whetherAuditEventsource name matches the check pattern.- Parameters:
event-AuditEventinstance.- Returns:
- true if the
AuditEventsource name matches the check pattern.
-
isIdMatch
Checks whether theAuditEventmodule ID matches the ID pattern.- Parameters:
event-AuditEventinstance.- Returns:
- true if the
AuditEventmodule ID matches the ID pattern.
-
isMessageMatch
Checks whether theAuditEventmessage matches the message pattern.- Parameters:
event-AuditEventinstance.- Returns:
- true if the
AuditEventmessage matches the message pattern.
-