Class SuppressionCommentFilter.Tag
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilter.Tag
-
- All Implemented Interfaces:
Comparable<SuppressionCommentFilter.Tag>
- Enclosing class:
- SuppressionCommentFilter
public static class SuppressionCommentFilter.Tag extends Object implements Comparable<SuppressionCommentFilter.Tag>
A Tag holds a suppression comment and its location, and determines whether the suppression turns checkstyle reporting on or off.- Author:
- Rick Giles
-
-
Constructor Summary
Constructors Constructor Description Tag(int line, int column, String text, boolean reportingOn, SuppressionCommentFilter filter)
Constructs a tag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(SuppressionCommentFilter.Tag object)
Compares the position of this tag in the file with the position of another tag.boolean
equals(Object other)
int
getColumn()
Determines the column number of the tag in the source file.int
getLine()
Returns line number of the tag in the source file.int
hashCode()
boolean
isMatch(AuditEvent event)
Determines whether the source of an audit event matches the text of this tag.boolean
isReportingOn()
Determines whether the suppression turns checkstyle reporting on or off.String
toString()
-
-
-
Constructor Detail
-
Tag
public Tag(int line, int column, String text, boolean reportingOn, SuppressionCommentFilter filter)
Constructs a tag.- Parameters:
line
- the line number.column
- the column number.text
- the text of the suppression.reportingOn
-true
if the tag turns checkstyle reporting.filter
- theSuppressionCommentFilter
with the context- Throws:
IllegalArgumentException
- if unable to parse expanded text.
-
-
Method Detail
-
getLine
public int getLine()
Returns line number of the tag in the source file.- Returns:
- the line number of the tag in the source file.
-
getColumn
public int getColumn()
Determines the column number of the tag in the source file. Will be 0 for all lines of multiline comment, except the first line.- Returns:
- the column number of the tag in the source file.
-
isReportingOn
public boolean isReportingOn()
Determines whether the suppression turns checkstyle reporting on or off.- Returns:
true
if the suppression turns reporting on.
-
compareTo
public int compareTo(SuppressionCommentFilter.Tag object)
Compares the position of this tag in the file with the position of another tag.- Specified by:
compareTo
in interfaceComparable<SuppressionCommentFilter.Tag>
- Parameters:
object
- 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.
-
isMatch
public boolean isMatch(AuditEvent event)
Determines whether the source of an audit event matches the text of this tag.- Parameters:
event
- theAuditEvent
to check.- Returns:
- true if the source of event matches the text of this tag.
-
-