Class SuppressWithNearbyTextFilter.Suppression

    • Field Detail

      • 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.
    • Constructor Detail

      • 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 Detail

      • 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.