Class SuppressWithNearbyTextFilter.Suppression
java.lang.Object
com.puppycrawl.tools.checkstyle.filters.SuppressWithNearbyTextFilter.Suppression
- Enclosing class:
- SuppressWithNearbyTextFilter
The class which represents the suppression.
- 
Field SummaryFieldsModifier 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 SummaryConstructorsModifierConstructorDescriptionprivateSuppression(String text, int lineNo, SuppressWithNearbyTextFilter filter) Constructs newSuppressioninstance.
- 
Method SummaryModifier 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- 
firstLineThe first line where warnings may be suppressed.
- 
lastLineThe last line where warnings may be suppressed.
- 
eventSourceRegexpThe regexp which is used to match the event source.
- 
eventMessageRegexpThe regexp which is used to match the event message.
- 
eventIdRegexpThe regexp which is used to match the event ID.
 
- 
- 
Constructor Details- 
SuppressionConstructs newSuppressioninstance.- Parameters:
- text- suppression text.
- lineNo- suppression line number.
- filter- the- SuppressWithNearbyTextFilterwith the context.
- Throws:
- IllegalArgumentException- if there is an error in the filter regex syntax.
 
 
- 
- 
Method Details- 
parseRangeGets range from suppress filter range format param.- Parameters:
- format- range format to parse
- lineRange- raw line range
- text- text of the suppression
- Returns:
- parsed range
- Throws:
- IllegalArgumentException- when unable to parse int in format
 
- 
isMatchDetermines whether the source of an audit event matches the text of this suppression.- Parameters:
- event- the- AuditEventto check.
- Returns:
- true if the source of event matches the text of this suppression.
 
- 
isInScopeOfSuppressionChecks whether theAuditEventis in the scope of the suppression.- Parameters:
- event-- AuditEventinstance.
- Returns:
- true if the AuditEventis in the scope of the suppression.
 
- 
isCheckMatchChecks whetherAuditEventsource name matches the check pattern.- Parameters:
- event-- AuditEventinstance.
- Returns:
- true if the AuditEventsource name matches the check pattern.
 
- 
isIdMatchChecks whether theAuditEventmodule ID matches the ID pattern.- Parameters:
- event-- AuditEventinstance.
- Returns:
- true if the AuditEventmodule ID matches the ID pattern.
 
- 
isMessageMatchChecks whether theAuditEventmessage matches the message pattern.- Parameters:
- event-- AuditEventinstance.
- Returns:
- true if the AuditEventmessage matches the message pattern.
 
 
-