Class SuppressWithNearbyCommentFilter.Tag

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int firstLine
      The first line where warnings may be suppressed.
      private int lastLine
      The last line where warnings may be suppressed.
      private java.util.regex.Pattern tagCheckRegexp
      The parsed check regexp, expanded for the text of this tag.
      private java.util.regex.Pattern tagMessageRegexp
      The parsed message regexp, expanded for the text of this tag.
      private java.lang.String text
      The text of the tag.
    • 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.
    • Constructor Detail

      • Tag

        public 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

      • compareTo

        public int compareTo​(SuppressWithNearbyCommentFilter.Tag other)
        Compares the position of this tag in the file with the position of another tag.
        Specified by:
        compareTo in interface java.lang.Comparable<SuppressWithNearbyCommentFilter.Tag>
        Parameters:
        other - the tag to compare with this one.
        Returns:
        a negative number if this tag is before the other tag, 0 if they are at the same position, and a positive number if this tag is after the other tag.
      • 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​(AuditEvent event)
        Determines whether the source of an audit event matches the text of this tag.
        Parameters:
        event - the AuditEvent to check.
        Returns:
        true if the source of event matches the text of this tag.
      • toString

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