Class SuppressWithPlainTextCommentFilter.Suppression
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.filters.SuppressWithPlainTextCommentFilter.Suppression
-
- Enclosing class:
- SuppressWithPlainTextCommentFilter
private static final class SuppressWithPlainTextCommentFilter.Suppression extends java.lang.Object
The class which represents the suppression.
-
-
Field Summary
Fields Modifier and Type Field Description private intcolumnNoSuppression column number.private java.util.regex.PatterneventIdRegexpThe regexp which is used to match the event ID.private java.util.regex.PatterneventMessageRegexpThe regexp which is used to match the event message.private java.util.regex.PatterneventSourceRegexpThe regexp which is used to match the event source.private intlineNoSuppression line.private SuppressWithPlainTextCommentFilter.SuppressionTypesuppressionTypeSuppression type.private java.lang.StringtextSuppression text.
-
Constructor Summary
Constructors Constructor Description Suppression(java.lang.String text, int lineNo, int columnNo, SuppressWithPlainTextCommentFilter.SuppressionType suppressionType, SuppressWithPlainTextCommentFilter filter)Creates new suppression instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Indicates whether some other object is "equal to" this one.inthashCode()private booleanisCheckMatch(AuditEvent event)Checks whetherAuditEventsource name matches the check format.private booleanisIdMatch(AuditEvent event)Checks whether theAuditEventmodule ID matches the ID format.private booleanisInScopeOfSuppression(AuditEvent event)Checks whetherAuditEventis in the scope of the suppression.private booleanisMatch(AuditEvent event)Checks whether the suppression matches the givenAuditEvent.private booleanisMessageMatch(AuditEvent event)Checks whether theAuditEventmessage matches the message format.
-
-
-
Field Detail
-
eventSourceRegexp
private final java.util.regex.Pattern eventSourceRegexp
The regexp which is used to match the event source.
-
eventMessageRegexp
private final java.util.regex.Pattern eventMessageRegexp
The regexp which is used to match the event message.
-
eventIdRegexp
private final java.util.regex.Pattern eventIdRegexp
The regexp which is used to match the event ID.
-
text
private final java.lang.String text
Suppression text.
-
lineNo
private final int lineNo
Suppression line.
-
columnNo
private final int columnNo
Suppression column number.
-
suppressionType
private final SuppressWithPlainTextCommentFilter.SuppressionType suppressionType
Suppression type.
-
-
Constructor Detail
-
Suppression
Suppression(java.lang.String text, int lineNo, int columnNo, SuppressWithPlainTextCommentFilter.SuppressionType suppressionType, SuppressWithPlainTextCommentFilter filter)
Creates new suppression instance.- Parameters:
text- suppression text.lineNo- suppression line number.columnNo- suppression column number.suppressionType- suppression type.filter- theSuppressWithPlainTextCommentFilterwith the context.- Throws:
java.lang.IllegalArgumentException- if there is an error in the filter regex syntax.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
Indicates whether some other object is "equal to" this one. Suppression on enumeration is needed so code stays consistent.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
isMatch
private boolean isMatch(AuditEvent event)
Checks whether the suppression matches the givenAuditEvent.- Parameters:
event-AuditEventinstance.- Returns:
- true if the suppression matches
AuditEvent.
-
isInScopeOfSuppression
private boolean isInScopeOfSuppression(AuditEvent event)
Checks whetherAuditEventis in the scope of the suppression.- Parameters:
event-AuditEventinstance.- Returns:
- true if
AuditEventis in the scope of the suppression.
-
isCheckMatch
private boolean isCheckMatch(AuditEvent event)
Checks whetherAuditEventsource name matches the check format.- Parameters:
event-AuditEventinstance.- Returns:
- true if the
AuditEventsource name matches the check format.
-
isIdMatch
private boolean isIdMatch(AuditEvent event)
Checks whether theAuditEventmodule ID matches the ID format.- Parameters:
event-AuditEventinstance.- Returns:
- true if the
AuditEventmodule ID matches the ID format.
-
isMessageMatch
private boolean isMessageMatch(AuditEvent event)
Checks whether theAuditEventmessage matches the message format.- Parameters:
event-AuditEventinstance.- Returns:
- true if the
AuditEventmessage matches the message format.
-
-