Class SuppressWithNearbyCommentFilter.Tag

  • Enclosing class:
    SuppressWithNearbyCommentFilter

    private static final class SuppressWithNearbyCommentFilter.Tag
    extends java.lang.Object
    A Tag holds a suppression comment and its location.
    • Field Detail

      • text

        private final java.lang.String text
        The text of the tag.
      • 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.
      • tagCheckRegexp

        private final java.util.regex.Pattern tagCheckRegexp
        The parsed check regexp, expanded for the text of this tag.
      • tagMessageRegexp

        private final java.util.regex.Pattern tagMessageRegexp
        The parsed message regexp, expanded for the text of this tag.
      • tagIdRegexp

        private final java.util.regex.Pattern tagIdRegexp
        The parsed check ID regexp, expanded for the text of this tag.
    • Constructor Detail

      • Tag

        Tag​(java.lang.String text,
            int line,
            SuppressWithNearbyCommentFilter filter)
        Constructs a tag.
        Parameters:
        text - the text of the suppression.
        line - the line number.
        filter - the SuppressWithNearbyCommentFilter with the context
        Throws:
        java.lang.IllegalArgumentException - if unable to parse expanded text.
    • Method Detail

      • parseInfluence

        private static int parseInfluence​(java.lang.String format,
                                          java.lang.String influenceFormat,
                                          java.lang.String text)
        Gets influence from suppress filter influence format param.
        Parameters:
        format - influence format to parse
        influenceFormat - raw influence format
        text - text of the suppression
        Returns:
        parsed influence
        Throws:
        java.lang.IllegalArgumentException - when unable to parse int in format
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isMatch

        public boolean isMatch​(TreeWalkerAuditEvent event)
        Determines whether the source of an audit event matches the text of this tag.
        Parameters:
        event - the TreeWalkerAuditEvent to check.
        Returns:
        true if the source of event matches the text of this tag.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object