Class SuppressWithNearbyTextFilter.Suppression

java.lang.Object
com.puppycrawl.tools.checkstyle.filters.SuppressWithNearbyTextFilter.Suppression
Enclosing class:
SuppressWithNearbyTextFilter

private static final class SuppressWithNearbyTextFilter.Suppression extends Object
The class which represents the suppression.
  • Field Details

    • firstLine

      private final int firstLine
      The first line where warnings may be suppressed.
    • lastLine

      private final int lastLine
      The last line where warnings may be suppressed.
    • eventSourceRegexp

      private final Pattern 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

      private Suppression(String text, int lineNo, SuppressWithNearbyTextFilter filter)
      Constructs new Suppression instance.
      Parameters:
      text - suppression text.
      lineNo - suppression line number.
      filter - the SuppressWithNearbyTextFilter with the context.
      Throws:
      IllegalArgumentException - if there is an error in the filter regex syntax.
  • Method Details

    • parseRange

      private static int parseRange(String format, String lineRange, String text)
      Gets 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
    • isMatch

      private boolean isMatch(AuditEvent event)
      Determines whether the source of an audit event matches the text of this suppression.
      Parameters:
      event - the AuditEvent to check.
      Returns:
      true if the source of event matches the text of this suppression.
    • isInScopeOfSuppression

      private boolean isInScopeOfSuppression(AuditEvent event)
      Checks whether the AuditEvent is in the scope of the suppression.
      Parameters:
      event - AuditEvent instance.
      Returns:
      true if the AuditEvent is in the scope of the suppression.
    • isCheckMatch

      private boolean isCheckMatch(AuditEvent event)
      Checks whether AuditEvent source name matches the check pattern.
      Parameters:
      event - AuditEvent instance.
      Returns:
      true if the AuditEvent source name matches the check pattern.
    • isIdMatch

      private boolean isIdMatch(AuditEvent event)
      Checks whether the AuditEvent module ID matches the ID pattern.
      Parameters:
      event - AuditEvent instance.
      Returns:
      true if the AuditEvent module ID matches the ID pattern.
    • isMessageMatch

      private boolean isMessageMatch(AuditEvent event)
      Checks whether the AuditEvent message matches the message pattern.
      Parameters:
      event - AuditEvent instance.
      Returns:
      true if the AuditEvent message matches the message pattern.